Spring Security 3 programmatically login

前端 未结 3 2300
闹比i
闹比i 2021-02-06 19:13

I\'m creating a REST web service using spring and I need to implement login/logout functions in it. The url for the functions should be something like .../api/login and .../api/

3条回答
  •  爱一瞬间的悲伤
    2021-02-06 19:46

    The best way is to plugin your authentication implementation into Spring Security. You can do it by registering your own "authentication provider" into Spring Security.

    For example:

    
        
            
                
            
        
    
    
    
    

    Another thing: I know it's a time consuming, but after reading Spring Security reference you will definitely get the "big picture" :-)

提交回复
热议问题