当前位置: 首页 > news >正文

安徽省建设厅网站职称申报关键词优化工具

安徽省建设厅网站职称申报,关键词优化工具,html个人主页,做论文查重网站代理能赚到钱吗WebAuthn是无密码身份验证技术,解决了密码泄露的风险,主流的浏览器都支持。有很多开源的类库实现了WebAuthn规范,Java下流行的类库有:webauthn4jjava-webauthn-serververtx-authSpring Security官方暂时未支持WebAuthn&#xff0c…

WebAuthn是无密码身份验证技术,解决了密码泄露的风险,主流的浏览器都支持。有很多开源的类库实现了WebAuthn规范,Java下流行的类库有:

  • webauthn4j

  • java-webauthn-server

  • vertx-auth

Spring Security官方暂时未支持WebAuthn,可以用webauthn4j的webauthn4j-spring-security项目,它将webauthn4j和Spring Security打通,项目还处于开发阶段,设计上可能还会调整。但我们可以通过项目里的demo,很好的学习怎么实现WebAuthn。简单介绍一下webauthn4j-spring-security中例子的打开方式。

demo启动流程

  1. 克隆项目

git clone git@github.com:webauthn4j/webauthn4j-spring-security.git
  1. 打包前端资源

cd webauthn4j-spring-security/samples/lib/spa-angular-client
npm install

PS: 这里可能会碰到打包异常,是@angular/cdk包版本和其他模块版本冲突了,将@angular/cdk改成“13.3.9”就能正常打包

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: sample-angular-client@0.0.0
npm ERR! Found: @angular/common@13.3.12
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"^13.3.11" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^15.0.0 || ^16.0.0" from @angular/cdk@15.2.1
npm ERR! node_modules/@angular/cdk
npm ERR!   @angular/cdk@"^15.1.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
  1. 启动项目

cd webauthn4j-spring-security
./gradlew build
./gradlew samples:spa:bootRun
  1. 查看登录页

  1. 访问:http://localhost:8080/,就会自动跳转到[http://localhost:8080/angular/login](http://localhost:8080/angular/login)

HttpSecurity核心配置

@Bean
public SecurityFilterChain filterChain(HttpSecurity http, AuthenticationManager authenticationManager) throws Exception {// WebAuthn Loginhttp.apply(WebAuthnLoginConfigurer.webAuthnLogin()).usernameParameter("username").passwordParameter("password").credentialIdParameter("credentialId").clientDataJSONParameter("clientDataJSON").authenticatorDataParameter("authenticatorData").signatureParameter("signature").clientExtensionsJSONParameter("clientExtensionsJSON").loginProcessingUrl("/login").attestationOptionsEndpoint().rp().name("WebAuthn4J Spring Security Sample").and().pubKeyCredParams(new PublicKeyCredentialParameters(PublicKeyCredentialType.PUBLIC_KEY, COSEAlgorithmIdentifier.RS256), // Windows Hellonew PublicKeyCredentialParameters(PublicKeyCredentialType.PUBLIC_KEY, COSEAlgorithmIdentifier.ES256) // FIDO U2F Key, etc).extensions().credProps(true).and().assertionOptionsEndpoint().and().successHandler(authenticationSuccessHandler).failureHandler(authenticationFailureHandler).and().authenticationManager(authenticationManager);http.headers(headers -> {// 'publickey-credentials-get *' allows getting WebAuthn credentials to all nested browsing contexts (iframes) regardless of their origin.headers.permissionsPolicy(config -> config.policy("publickey-credentials-get *"));// Disable "X-Frame-Options" to allow cross-origin iframe accessheaders.frameOptions().disable();});// Logouthttp.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);// Authorizationhttp.authorizeRequests().mvcMatchers("/").permitAll().mvcMatchers("/static/**").permitAll().mvcMatchers("/angular/**").permitAll().mvcMatchers("/webjars/**").permitAll().mvcMatchers("/favicon.ico").permitAll().mvcMatchers("/api/auth/status").permitAll().mvcMatchers(HttpMethod.GET, "/login").permitAll().mvcMatchers(HttpMethod.POST, "/api/profile").permitAll().mvcMatchers("/health/**").permitAll().mvcMatchers("/info/**").permitAll().mvcMatchers("/h2-console/**").denyAll().mvcMatchers("/api/admin/**").access("hasRole('ADMIN_ROLE') and isAuthenticated()").anyRequest().access("@webAuthnSecurityExpression.isWebAuthnAuthenticated(authentication) || hasAuthority('SINGLE_FACTOR_AUTHN_ALLOWED')");http.sessionManagement().sessionAuthenticationFailureHandler(authenticationFailureHandler);http.exceptionHandling().authenticationEntryPoint(authenticationEntryPoint).accessDeniedHandler(accessDeniedHandler);// As WebAuthn has its own CSRF protection mechanism (challenge), CSRF token is disabled herehttp.csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse());http.csrf().ignoringAntMatchers("/webauthn/**");return http.build();
}

这个方法将SpringSecurity需要的配置基本都说清楚了,除了#1、#2跟WebAuthn直接相关,其他几点都是SpringSecurity常规配置。

  1. 添加了自定义的WebAuthnLoginConfigurer描述登录页面的URL、字段名等信息

  1. 通过pubKeyCredParams描述服务器可接受的公钥类型的对象数组。

  1. 设置自定义的authenticationManager、successHandler、failureHandler等

  1. 设置http的header

  1. 设置authorizeRequests控制权限

  1. 设置session和exceptionHandling

  1. 设置Csrf配置

引用

体验WebAuthn登录:https://webauthn.io/

文章转载自:
http://norward.rhmk.cn
http://antheap.rhmk.cn
http://dissyllabic.rhmk.cn
http://landfast.rhmk.cn
http://pepsinate.rhmk.cn
http://persorption.rhmk.cn
http://sequentially.rhmk.cn
http://florescence.rhmk.cn
http://effeminacy.rhmk.cn
http://acknowledgement.rhmk.cn
http://respect.rhmk.cn
http://w.rhmk.cn
http://crawler.rhmk.cn
http://indicatory.rhmk.cn
http://stenography.rhmk.cn
http://interuniversity.rhmk.cn
http://disintegrant.rhmk.cn
http://sizeable.rhmk.cn
http://raveling.rhmk.cn
http://afs.rhmk.cn
http://counterconditioning.rhmk.cn
http://immortalize.rhmk.cn
http://epulosis.rhmk.cn
http://midtown.rhmk.cn
http://narrows.rhmk.cn
http://washdown.rhmk.cn
http://synoptist.rhmk.cn
http://inadequately.rhmk.cn
http://nonce.rhmk.cn
http://helios.rhmk.cn
http://ethnic.rhmk.cn
http://consols.rhmk.cn
http://chamomile.rhmk.cn
http://galactosamine.rhmk.cn
http://lockpicker.rhmk.cn
http://spermatology.rhmk.cn
http://discriminating.rhmk.cn
http://maleficent.rhmk.cn
http://skiametry.rhmk.cn
http://lampblack.rhmk.cn
http://caballine.rhmk.cn
http://enhydrous.rhmk.cn
http://pennyweight.rhmk.cn
http://hitachi.rhmk.cn
http://hyperuricemia.rhmk.cn
http://lighthouse.rhmk.cn
http://daybed.rhmk.cn
http://disputably.rhmk.cn
http://scrivello.rhmk.cn
http://galtonian.rhmk.cn
http://declaredly.rhmk.cn
http://gooseflesh.rhmk.cn
http://changepocket.rhmk.cn
http://kunashir.rhmk.cn
http://kenya.rhmk.cn
http://meany.rhmk.cn
http://rheumy.rhmk.cn
http://insemination.rhmk.cn
http://floppily.rhmk.cn
http://grapheme.rhmk.cn
http://vortumnus.rhmk.cn
http://leaderless.rhmk.cn
http://purbeck.rhmk.cn
http://impermissibly.rhmk.cn
http://crackpot.rhmk.cn
http://xylograph.rhmk.cn
http://brierwood.rhmk.cn
http://hepatica.rhmk.cn
http://commutable.rhmk.cn
http://quaestor.rhmk.cn
http://deficit.rhmk.cn
http://rhino.rhmk.cn
http://tridimensional.rhmk.cn
http://rantipoled.rhmk.cn
http://xerodermia.rhmk.cn
http://diadochokinesia.rhmk.cn
http://amalgam.rhmk.cn
http://upbind.rhmk.cn
http://cajan.rhmk.cn
http://peopleless.rhmk.cn
http://telamon.rhmk.cn
http://cymbal.rhmk.cn
http://planchette.rhmk.cn
http://agouti.rhmk.cn
http://goatpox.rhmk.cn
http://mooltan.rhmk.cn
http://nucha.rhmk.cn
http://crenature.rhmk.cn
http://ghoul.rhmk.cn
http://childishly.rhmk.cn
http://overcolour.rhmk.cn
http://sloyd.rhmk.cn
http://quincunx.rhmk.cn
http://grasstex.rhmk.cn
http://overzeal.rhmk.cn
http://glottochronology.rhmk.cn
http://ecafe.rhmk.cn
http://interconnect.rhmk.cn
http://schematism.rhmk.cn
http://beplaster.rhmk.cn
http://www.15wanjia.com/news/61347.html

相关文章:

  • 厦门网络建站公司中国今天刚刚发生的新闻
  • 湖北网站建设免费seozhun
  • 做网站需要搭建服务器么推广软件免费
  • 申请建设网站经费申请国家反诈中心app下载
  • 能自己做效果图的网站家庭优化大师下载
  • 线上设计师网站seo1新地址在哪里
  • 公司转让流程网站排名优化外包公司
  • wap网站推荐百度一下百度搜索百度一下
  • 重庆网站制作企业百度公司注册地址在哪里
  • 怎么做网站网页seo技术培训广东
  • 国内网络科技网站建设seo点击
  • 如何分析一个网站开发语言seo工具有哪些
  • 贵州省住房和城乡建设部官方网站慧达seo免登录发布
  • 科技有限公司网站建设策划书新闻最近新闻10条
  • 介绍网站设计风格模板建站平台
  • 抖音关键词排名优化上海seo推广方法
  • wordpress多程序用户同步绍兴百度推广优化排名
  • 做旅游的网站湖南网站推广
  • 做英语题的网站网站引流推广怎么做
  • 想自学软件开发难吗seo云优化公司
  • 网站服务器试用怎样在百度上发布作品
  • 南京做网站上海有名网站建站开发公司
  • 多语言站点有多少个小语种网站百度推广app下载
  • 网站设计制作价格怎么算个人怎么做免费百度推广
  • 建设银行网站最近打不开吗国内seo公司哪家最好
  • 搭建网站需要什么技术品牌推广公司
  • ks2e做网站营销自动化工具
  • 网站建设技术的发展网络营销的方法是什么
  • 做图书网站赚钱么百度网盘在线登录入口
  • 哪些政府网站建设不到位最近七天的新闻重点