Hooking into pre-authentication with spring-security-core

后端 未结 1 633
长发绾君心
长发绾君心 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:

    <authentication-manager>
      <authentication-provider ref="myAuthenticationProvider" />
    </authentication-manager>
    
    0 讨论(0)
提交回复
热议问题