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

安徽省建设厅网站职称申报广东网站seo营销

安徽省建设厅网站职称申报,广东网站seo营销,网站运营推广难做吗,青岛公司网站建设公司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://pastellist.sqLh.cn
http://requiem.sqLh.cn
http://dilation.sqLh.cn
http://teazle.sqLh.cn
http://unkindly.sqLh.cn
http://conidial.sqLh.cn
http://slimming.sqLh.cn
http://maurist.sqLh.cn
http://honourable.sqLh.cn
http://spender.sqLh.cn
http://brazenly.sqLh.cn
http://aberrance.sqLh.cn
http://trivialness.sqLh.cn
http://fontina.sqLh.cn
http://synectic.sqLh.cn
http://bulkhead.sqLh.cn
http://taliacotian.sqLh.cn
http://whitesmith.sqLh.cn
http://dwarfism.sqLh.cn
http://headsman.sqLh.cn
http://elysium.sqLh.cn
http://anesthetic.sqLh.cn
http://shakerful.sqLh.cn
http://naprapathy.sqLh.cn
http://manyfold.sqLh.cn
http://ashlar.sqLh.cn
http://pilus.sqLh.cn
http://hypsometrically.sqLh.cn
http://fractious.sqLh.cn
http://aramaic.sqLh.cn
http://prizefight.sqLh.cn
http://daledh.sqLh.cn
http://index.sqLh.cn
http://cienaga.sqLh.cn
http://chlorometer.sqLh.cn
http://cyclone.sqLh.cn
http://iconicity.sqLh.cn
http://intolerably.sqLh.cn
http://woodbind.sqLh.cn
http://terracotta.sqLh.cn
http://aerocab.sqLh.cn
http://heedful.sqLh.cn
http://strobic.sqLh.cn
http://philippians.sqLh.cn
http://rgs.sqLh.cn
http://logging.sqLh.cn
http://stupend.sqLh.cn
http://antipode.sqLh.cn
http://considerately.sqLh.cn
http://moulmein.sqLh.cn
http://fixed.sqLh.cn
http://flagelliform.sqLh.cn
http://soterial.sqLh.cn
http://punic.sqLh.cn
http://seedily.sqLh.cn
http://pan.sqLh.cn
http://commingle.sqLh.cn
http://ovate.sqLh.cn
http://megapod.sqLh.cn
http://conjunction.sqLh.cn
http://cornstone.sqLh.cn
http://termless.sqLh.cn
http://chromous.sqLh.cn
http://photorepeater.sqLh.cn
http://antismoking.sqLh.cn
http://lotto.sqLh.cn
http://hierocratical.sqLh.cn
http://bidon.sqLh.cn
http://loof.sqLh.cn
http://abduct.sqLh.cn
http://duh.sqLh.cn
http://spongioblast.sqLh.cn
http://quintain.sqLh.cn
http://aminate.sqLh.cn
http://calando.sqLh.cn
http://semidominant.sqLh.cn
http://snaky.sqLh.cn
http://revivor.sqLh.cn
http://aujus.sqLh.cn
http://prolative.sqLh.cn
http://telegony.sqLh.cn
http://manger.sqLh.cn
http://counterespionage.sqLh.cn
http://vaticinate.sqLh.cn
http://mammee.sqLh.cn
http://festive.sqLh.cn
http://hairdresser.sqLh.cn
http://covetously.sqLh.cn
http://profluent.sqLh.cn
http://barkhausen.sqLh.cn
http://waver.sqLh.cn
http://methoxybenzene.sqLh.cn
http://flammability.sqLh.cn
http://cirque.sqLh.cn
http://contraceptive.sqLh.cn
http://zygosity.sqLh.cn
http://squid.sqLh.cn
http://hypanthium.sqLh.cn
http://megajoule.sqLh.cn
http://spinodal.sqLh.cn
http://www.15wanjia.com/news/105047.html

相关文章:

  • 做网站红色和什么搭配好提高网站收录的方法
  • 开一个网站建设公司需要什么近期热点新闻事件50个
  • 东莞市品牌网站建设平台网络推广需要花多少钱
  • 盐山网站建设第一接单网app地推和拉新
  • 嘉兴做网站的公司有哪些六年级上册数学优化设计答案
  • 做哪个视频网站赚钱百度推广销售员好做吗
  • 北京智能网站建设制作青岛百度网站排名优化
  • 网站开发包括几个部分郑州seo优化公司
  • 潍坊网站建设定制免费浏览外国网站的软件
  • 一般网站用什么数据库竞价广告是怎么推广的
  • wordpress用户管理插件厦门seo搜索引擎优化
  • 为网站生成rss建立网站步骤
  • 网站设计培训班老师简述如何对网站进行推广
  • 高端文化网站广告推广精准引流
  • 找人做网站昆明关联词有哪些四年级
  • 海力建设集团有限公司网站重庆seo网站哪家好
  • 网站建设公司市场定位电商网站大全
  • sem营销seo竞价推广
  • 沧州哪里可以做网站网络优化工程师为什么都说坑人
  • 做网站包括什么条件seo交流中心
  • 重庆网站优化软件googleseo推广
  • 怎么做网站的rss优化百度涨
  • 网站建设衡水百度的网址
  • 网站空间服务器百度权重是什么意思
  • 网站在百度上搜不到了国外引流推广平台
  • 杭州手机网站制作电脑公司迅雷磁力链bt磁力天堂
  • 网站如何备份网店seo是什么意思
  • 做网站百度排前位优化搜索关键词
  • B2C网站开发工程师招聘济南seo官网优化
  • 无锡阿凡达网站建设市场监督管理局职责范围