インターフェース AuthenticationProvider

すべての既知の実装クラス:
AbstractJaasAuthenticationProviderAbstractLdapAuthenticationProviderAbstractUserDetailsAuthenticationProviderActiveDirectoryLdapAuthenticationProviderAnonymousAuthenticationProviderAuthenticationManagerBeanDefinitionParser.NullAuthenticationProviderCasAuthenticationProviderDaoAuthenticationProviderDefaultJaasAuthenticationProviderJaasAuthenticationProviderJwtAuthenticationProviderLdapAuthenticationProviderOAuth2AuthorizationCodeAuthenticationProviderOAuth2LoginAuthenticationProviderOidcAuthorizationCodeAuthenticationProviderOpaqueTokenAuthenticationProviderOpenSaml4AuthenticationProviderPreAuthenticatedAuthenticationProviderRememberMeAuthenticationProviderRunAsImplAuthenticationProviderTestingAuthenticationProvider

public interface AuthenticationProvider
クラスが特定の Authentication 実装を処理できることを示します。
  • メソッドの詳細

    • authenticate

      Authentication authenticate(Authentication authentication) throws AuthenticationException
      AuthenticationManager.authenticate(Authentication) と同じ契約で認証を実行します。
      パラメーター:
      authentication - 認証リクエストオブジェクト。
      戻り値:
      資格情報を含む完全に認証されたオブジェクト。AuthenticationProvider が、渡された Authentication オブジェクトの認証をサポートできない場合、null を返すことがあります。そのような場合、提示された Authentication クラスをサポートする次の AuthenticationProvider が試行されます。
      例外:
      AuthenticationException - 認証が失敗した場合。
    • supports

      boolean supports(ClassSE<?> authentication)
      この AuthenticationProvider が指定された Authentication オブジェクトをサポートする場合、true を返します。

      true を返すことは、AuthenticationProvider が Authentication クラスの提示されたインスタンスを認証できることを保証しません。それは、それがより詳細な評価をサポートできることを示しています。AuthenticationProvider は、authenticate(Authentication) メソッドから null を返して、別の AuthenticationProvider を試す必要があることを示すことができます。

      認証を実行できる AuthenticationProvider の選択は、実行時に ProviderManager で行われます。

      パラメーター:
      authentication -
      戻り値:
      実装が提示された Authentication クラスをより厳密に評価できる場合は true