spring oauth refresh-token 401问题
解决:
@Overridepublic void configure(AuthorizationServerSecurityConfigurer oauthServer) throws Exception {oauthServer.allowFormAuthenticationForClients();oauthServer.checkTokenAccess("isAuthenticated()");}
出现No AuthenticationProvider found for org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken
解决:
PreAuthenticatedAuthenticationProvider preAuthenticatedAuthenticationProvider() {PreAuthenticatedAuthenticationProvider preAuthenticatedAuthenticationProvider = new PreAuthenticatedAuthenticationProvider();preAuthenticatedAuthenticationProvider.setPreAuthenticatedUserDetailsService(new UserDetailsByNameServiceWrapper(tbUserService));return preAuthenticatedAuthenticationProvider;}@Overrideprotected void configure(AuthenticationManagerBuilder auth) throws Exception {auth.userDetailsService(tbUserService).passwordEncoder(bCryptPasswordEncoder);auth.authenticationProvider(preAuthenticatedAuthenticationProvider());}