How do I map OAuth 2 token to UserDetails object in a resource server?

后端 未结 2 934
别跟我提以往
别跟我提以往 2021-02-02 01:13

I have 2 separate Spring Boot applications, one serving as an an OAuth 2 authorization server, and the other as resource server. I\'m using Spring\'s RemoteTokenServices

2条回答
  •  星月不相逢
    2021-02-02 02:04

    Did you enable the AuthenticationPrincipalArgumentResolver, like following xml?

    
            
                    
            
    
    

    And you need to implement the UserDetails to return your own CustomerUser object, then you can use the annotation to get principal directly.

提交回复
热议问题