this mvc version: `@Bean @Order(Ordered.HIGHEST_PRECEDENCE) public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception { http.setSharedObject(AuthorizationServerSettings.class, AuthorizationServerSettings.builder().build());
OAuth2AuthorizationServerConfigurer authorizationServerConfigurer = new OAuth2AuthorizationServerConfigurer();
authorizationServerConfigurer.tokenEndpoint(tokenEndpoint -> {
// 设置获取token多种验证方式
tokenEndpoint.accessTokenRequestConverters((list) -> {
// 设置多种token转换器
list.add(new SmsAuthenticationConverter());
list.add(new WechatAuthenticationConverter());
});
tokenEndpoint.authenticationProviders(list -> {
// 设置多种token认证器
list.add(smsCodeAuthenticationProvider());
list.add(wechatAuthenticationProvider());
});
});
authorizationServerConfigurer.clientAuthentication(oAuth2ClientAuthenticationConfigurer -> {
// 设置获取token时,必须给定客户端的AUTHORIZATION, 不然不给,也能获取token
oAuth2ClientAuthenticationConfigurer.authenticationConverter(new ClientSecretAuthenticationConverter());
});
http.apply(authorizationServerConfigurer);
http.authorizeHttpRequests()
.requestMatchers("/oauth2/token").permitAll()
.anyRequest().authenticated();
// 设置访问资源时,采用jwt验证
http.oauth2ResourceServer()
.jwt();
return http.csrf().disable().build();
}`
change to reactive version, what's that code?
Comment From: jzheaux
Thanks for getting in touch! It feels like this is a question that would be better suited to Stack Overflow. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add more detail if you feel this is a genuine bug.