Spring Security OAuth2 pure resource server

后端 未结 2 1148
孤街浪徒
孤街浪徒 2021-02-01 06:46

We already have an OAuth2 authorization server set up, so I need to create a corresponding resource server (separate server). We plan to use the Spring Security OAuth2 project.

2条回答
  •  佛祖请我去吃肉
    2021-02-01 07:13

    This is possible as long as the authorization server and resource server(s) access a shared tokenStore (e.g. using JdbcTokenStore with a common dataSource). You can just use DefaultTokenServices with a reference to your shared tokenStore. Below is an example Spring config which you should be able to tweak to fit your needs:

    
    
    
    
        
    
    
    
        
    
    
    
        
    
    
    
    
    
        
            
                
                
                
            
        
    
    
    
    
    
    
    
    
    
    
        
    
    
    
    
    
        
        
        
        
        
        
        
        
        
        
    
    
    

提交回复
热议问题