public abstract class AbstractLdapAuthenticationProvider extends java.lang.Object implements AuthenticationProvider, org.springframework.context.MessageSourceAware
LdapAuthenticationProvider および ActiveDirectoryLdapAuthenticationProvider の基本クラス。| 修飾子と型 | フィールドと説明 |
|---|---|
protected org.apache.commons.logging.Log | logger |
protected org.springframework.context.support.MessageSourceAccessor | messages |
protected UserDetailsContextMapper | userDetailsContextMapper |
| コンストラクターと説明 |
|---|
AbstractLdapAuthenticationProvider() |
| 修飾子と型 | メソッドと説明 |
|---|---|
Authentication | authenticate(Authentication authentication)AuthenticationManager.authenticate(Authentication) と同じ契約で認証を実行します。 |
protected Authentication | createSuccessfulAuthentication(UsernamePasswordAuthenticationToken authentication, UserDetails user)authenticate メソッドから返される最終的な Authentication オブジェクトを作成します。 |
protected abstract org.springframework.ldap.core.DirContextOperations | doAuthentication(UsernamePasswordAuthenticationToken auth) |
protected UserDetailsContextMapper | getUserDetailsContextMapper() サブクラスで使用するために注入された UserDetailsContextMapper 戦略へのアクセスを提供します。 |
protected abstract java.util.Collection<? extends GrantedAuthority> | loadUserAuthorities(org.springframework.ldap.core.DirContextOperations userData, java.lang.String username, java.lang.String password) |
void | setAuthoritiesMapper(GrantedAuthoritiesMapper authoritiesMapper) |
void | setMessageSource(org.springframework.context.MessageSource messageSource) |
void | setUseAuthenticationRequestCredentials(boolean useAuthenticationRequestCredentials) 提供されたパスワードを、成功した認証トークンの資格情報として使用するかどうかを決定します。 |
void | setUserDetailsContextMapper(UserDetailsContextMapper userDetailsContextMapper)createSuccessfulAuthentication(org.springframework.security.authentication.UsernamePasswordAuthenticationToken, org.springframework.security.core.userdetails.UserDetails) メソッドによって返される Authentication のプリンシパルとして格納される UserDetails の作成にカスタム戦略を使用できるようにします。 |
boolean | supports(java.lang.Class<?> authentication) この AuthenticationProvider が指定された Authentication オブジェクトをサポートする場合、true を返します。 |
protected final org.apache.commons.logging.Log logger
protected org.springframework.context.support.MessageSourceAccessor messages
protected UserDetailsContextMapper userDetailsContextMapper
public Authentication authenticate(Authentication authentication) throws AuthenticationException
AuthenticationProviderAuthenticationManager.authenticate(Authentication) と同じ契約で認証を実行します。AuthenticationProvider 内の authenticate authentication - 認証リクエストオブジェクト。AuthenticationProvider が、渡された Authentication オブジェクトの認証をサポートできない場合、null を返すことがあります。そのような場合、提示された Authentication クラスをサポートする次の AuthenticationProvider が試行されます。AuthenticationException - 認証が失敗した場合。protected abstract org.springframework.ldap.core.DirContextOperations doAuthentication(UsernamePasswordAuthenticationToken auth)
protected abstract java.util.Collection<? extends GrantedAuthority> loadUserAuthorities(org.springframework.ldap.core.DirContextOperations userData, java.lang.String username, java.lang.String password)
protected Authentication createSuccessfulAuthentication(UsernamePasswordAuthenticationToken authentication, UserDetails user)
authenticate メソッドから返される最終的な Authentication オブジェクトを作成します。authentication - 元の認証リクエストトークン user - 構成された UserDetailsContextMapper によって返される UserDetails インスタンス。public boolean supports(java.lang.Class<?> authentication)
AuthenticationProviderAuthenticationProvider が指定された Authentication オブジェクトをサポートする場合、true を返します。true を返すことは、AuthenticationProvider が Authentication クラスの提示されたインスタンスを認証できることを保証しません。それは、それがより詳細な評価をサポートできることを示しています。AuthenticationProvider は、AuthenticationProvider.authenticate(Authentication) メソッドから null を返して、別の AuthenticationProvider を試す必要があることを示すことができます。
認証を実行できる AuthenticationProvider の選択は、実行時に ProviderManager で行われます。
AuthenticationProvider 内の supports Authentication クラスをより厳密に評価できる場合は true public void setUseAuthenticationRequestCredentials(boolean useAuthenticationRequestCredentials)
UserDetailsContextMapper によって作成された UserDetails オブジェクトから取得されます。多くの場合、ディレクトリからパスワードを読み取ることができないため、デフォルトは true です。useAuthenticationRequestCredentials -public void setMessageSource(org.springframework.context.MessageSource messageSource)
org.springframework.context.MessageSourceAware 内の setMessageSource public void setAuthoritiesMapper(GrantedAuthoritiesMapper authoritiesMapper)
public void setUserDetailsContextMapper(UserDetailsContextMapper userDetailsContextMapper)
createSuccessfulAuthentication(org.springframework.security.authentication.UsernamePasswordAuthenticationToken, org.springframework.security.core.userdetails.UserDetails) メソッドによって返される Authentication のプリンシパルとして格納される UserDetails の作成にカスタム戦略を使用できるようにします。userDetailsContextMapper - 戦略インスタンス。設定されていない場合、デフォルトは単純な LdapUserDetailsMapper です。protected UserDetailsContextMapper getUserDetailsContextMapper()
UserDetailsContextMapper 戦略へのアクセスを提供します。