クラス AbstractLdapAuthenticationProvider

java.lang.ObjectSE
org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider
実装されたすべてのインターフェース:
org.springframework.beans.factory.Awareorg.springframework.context.MessageSourceAwareAuthenticationProvider
既知の直属サブクラス
ActiveDirectoryLdapAuthenticationProviderLdapAuthenticationProvider

public abstract class AbstractLdapAuthenticationProvider extends ObjectSE implements AuthenticationProvider, org.springframework.context.MessageSourceAware
標準 LdapAuthenticationProvider および ActiveDirectoryLdapAuthenticationProvider の基本クラス。
導入:
3.1
  • フィールドの詳細

    • logger

      protected final org.apache.commons.logging.Log logger
    • messages

      protected org.springframework.context.support.MessageSourceAccessor messages
    • userDetailsContextMapper

      protected UserDetailsContextMapper userDetailsContextMapper
  • コンストラクターの詳細

    • AbstractLdapAuthenticationProvider

      public AbstractLdapAuthenticationProvider()
  • メソッドの詳細

    • authenticate

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

      protected abstract org.springframework.ldap.core.DirContextOperations doAuthentication(UsernamePasswordAuthenticationToken auth)
    • loadUserAuthorities

      protected abstract CollectionSE<? extends GrantedAuthority> loadUserAuthorities(org.springframework.ldap.core.DirContextOperations userData, StringSE username, StringSE password)
    • createSuccessfulAuthentication

      protected Authentication createSuccessfulAuthentication(UsernamePasswordAuthenticationToken authentication, UserDetails user)
      authenticate メソッドから返される最終的な Authentication オブジェクトを作成します。
      パラメーター:
      authentication - 元の認証リクエストトークン
      user - 構成された UserDetailsContextMapper によって返される UserDetails インスタンス。
      戻り値:
      完全に認証されたユーザーの認証オブジェクト。
    • supports

      public boolean supports(ClassSE<?> authentication)
      インターフェースからコピーされた説明: AuthenticationProvider
      この AuthenticationProvider が指定された Authentication オブジェクトをサポートする場合、true を返します。

      true を返しても、AuthenticationProvider が提示された Authentication オブジェクトを認証できることは保証されません。これは単に、より詳細な評価をサポートできることを示しているだけです。AuthenticationProvider は、AuthenticationProvider.authenticate(Authentication) メソッドから null を返して、別の AuthenticationProvider を試す必要があることを示すことができます。

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

      次で指定:
      インターフェース AuthenticationProvidersupports 
      戻り値:
      実装が提示された Authentication クラスをより厳密に評価できる場合は true 
    • setUseAuthenticationRequestCredentials

      public void setUseAuthenticationRequestCredentials(boolean useAuthenticationRequestCredentials)
      提供されたパスワードを、成功した認証トークンの資格情報として使用するかどうかを決定します。false に設定した場合、パスワードは、構成された UserDetailsContextMapper によって作成された UserDetails オブジェクトから取得されます。多くの場合、ディレクトリからパスワードを読み取ることができないため、デフォルトは true です。
      パラメーター:
      useAuthenticationRequestCredentials -
    • setMessageSource

      public void setMessageSource(org.springframework.context.MessageSource messageSource)
      次で指定:
      インターフェース org.springframework.context.MessageSourceAwaresetMessageSource 
    • setAuthoritiesMapper

      public void setAuthoritiesMapper(GrantedAuthoritiesMapper authoritiesMapper)
      ストレージからロードされた権限を、UsernamePasswordAuthenticationToken に関連付けられる新しい権限のセットに変換するために使用される GrantedAuthoritiesMapper を設定します。設定されていない場合、デフォルトで NullAuthoritiesMapper になります。
      パラメーター:
      authoritiesMapper - ユーザーの権限のマッピングに使用される GrantedAuthoritiesMapper
    • setUserDetailsContextMapper

      public void setUserDetailsContextMapper(UserDetailsContextMapper userDetailsContextMapper)
      createSuccessfulAuthentication(org.springframework.security.authentication.UsernamePasswordAuthenticationToken, org.springframework.security.core.userdetails.UserDetails) メソッドによって返される Authentication のプリンシパルとして格納される UserDetails の作成にカスタム戦略を使用できるようにします。
      パラメーター:
      userDetailsContextMapper - 戦略インスタンス。設定されていない場合、デフォルトは単純な LdapUserDetailsMapper です。
    • getUserDetailsContextMapper

      protected UserDetailsContextMapper getUserDetailsContextMapper()
      サブクラスで使用するために注入された UserDetailsContextMapper 戦略へのアクセスを提供します。