Hooking into pre-authentication with spring-security-core

后端 未结 1 623
长发绾君心
长发绾君心 2021-01-14 13:20

I\'m needing to do some custom things when a user tries to log in depending on their username but these things need to happen before the authentication process. Here\'s wha

1条回答
  •  清酒与你
    2021-01-14 14:16

    The simplest was to hook into the authentication process is to provide your own AuthenticationProvider. There are only two methods to implement. In authenticate() you can do all of your custom stuff.

    To configure your provider into the framework do something like:

    
      
    
    

    0 讨论(0)
提交回复
热议问题