Spring OAuth2 - There is no client authentication. Try adding an appropriate authentication filter

后端 未结 5 1042
梦毁少年i
梦毁少年i 2020-12-30 04:55

We have an application which is using spring-security-oauth2:1.0. I was trying to change it to a newer version, spring-security-oauth2:2.0.7.RELEASE

5条回答
  •  甜味超标
    2020-12-30 05:57

    One of the problems of the following error, can be that authentication was not performed. I have encountered this problem with older implementation of Spring.

    verify that:

    TokenEndpoint -> postAccessToken method. Check if Principal is not null. If it is null it means that Basic Authroziation was not performed.

    One of the solution to add filter was to use:

    @Configuration
    public class FilterChainInitializer extends AbstractSecurityWebApplicationInitializer {
    
    }
    

    More information about AbstractSecurityWebApplicationInitializer can be found in Spring docs

提交回复
热议问题