How to use RemoteTokenService?

后端 未结 2 399
面向向阳花
面向向阳花 2021-02-05 12:16

I have a separate ResourceServer built using Spring-Security-oauth2. Here is the code RemoteTokenService.

@Bean
public ResourceServerTokenServices tokenService()         


        
2条回答
  •  萌比男神i
    2021-02-05 13:13

    I have the following configuration:

    @Configuration
    @EnableWebSecurity
    @EnableAuthorizationServer
    public class OAuthSecurityConfig extends AuthorizationServerConfigurerAdapter {
    // ...
        @Override
        public void configure(AuthorizationServerSecurityConfigurer oauthServer) throws Exception {
            // (!)
            oauthServer.allowFormAuthenticationForClients();
        }
    // ...
    

    I added the following line:

        oauthServer.checkTokenAccess("permitAll()");
    

    into the line with "(!)" to fix the same problem.

提交回复
热议问题