クラス CasAuthenticationProvider
- java.lang.Object
-
- org.springframework.security.cas.authentication.CasAuthenticationProvider
- 実装されているすべてのインターフェース:
org.springframework.beans.factory.Aware
、org.springframework.beans.factory.InitializingBean
、org.springframework.context.MessageSourceAware
、AuthenticationProvider
public class CasAuthenticationProvider extends java.lang.Object implements AuthenticationProvider, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware
JA-SIG 中央認証サービス(CAS)と統合するAuthenticationProvider
実装。この
AuthenticationProvider
は、CasAuthenticationFilter.CAS_STATEFUL_IDENTIFIER
またはCasAuthenticationFilter.CAS_STATELESS_IDENTIFIER
のいずれかに等しいprincipal
名を含むUsernamePasswordAuthenticationToken
リクエストを検証することができます。以前に作成したCasAuthenticationToken
を検証することもできます。
フィールドのサマリー
フィールド 修飾子と型 フィールド 説明 protected org.springframework.context.support.MessageSourceAccessor
messages
コンストラクターの概要
コンストラクター コンストラクター 説明 CasAuthenticationProvider()
メソッドのサマリー
すべてのメソッド インスタンスメソッド 具象メソッド 修飾子と型 メソッド 説明 void
afterPropertiesSet()
Authentication
authenticate(Authentication authentication)
AuthenticationManager.authenticate(Authentication)
と同じ契約で認証を実行します。protected java.lang.String
getKey()
StatelessTicketCache
getStatelessTicketCache()
protected org.jasig.cas.client.validation.TicketValidator
getTicketValidator()
protected UserDetails
loadUserByAssertion(org.jasig.cas.client.validation.Assertion assertion)
アサーションに基づいて UserDetails を取得するためのテンプレートメソッド。void
setAuthenticationUserDetailsService(AuthenticationUserDetailsService<CasAssertionAuthenticationToken> authenticationUserDetailsService)
void
setAuthoritiesMapper(GrantedAuthoritiesMapper authoritiesMapper)
void
setKey(java.lang.String key)
void
setMessageSource(org.springframework.context.MessageSource messageSource)
void
setServiceProperties(ServiceProperties serviceProperties)
void
setStatelessTicketCache(StatelessTicketCache statelessTicketCache)
void
setTicketValidator(org.jasig.cas.client.validation.TicketValidator ticketValidator)
void
setUserDetailsService(UserDetailsService userDetailsService)
boolean
supports(java.lang.Class<?> authentication)
このAuthenticationProvider
が指定されたAuthentication
オブジェクトをサポートする場合、true
を返します。
メソッドの詳細
afterPropertiesSet
public void afterPropertiesSet()
- 次で指定:
- インターフェース
org.springframework.beans.factory.InitializingBean
のafterPropertiesSet
authenticate
public Authentication authenticate(Authentication authentication) throws AuthenticationException
インターフェースからコピーされた説明:AuthenticationProvider
AuthenticationManager.authenticate(Authentication)
と同じ契約で認証を実行します。- 次で指定:
- インターフェース
AuthenticationProvider
のauthenticate
- パラメーター:
authentication
- 認証リクエストオブジェクト。- 戻り値:
- 資格情報を含む完全に認証されたオブジェクト。
AuthenticationProvider
が、渡されたAuthentication
オブジェクトの認証をサポートできない場合、null
を返すことがあります。そのような場合、提示されたAuthentication
クラスをサポートする次のAuthenticationProvider
が試行されます。 - 例外:
AuthenticationException
- 認証が失敗した場合。
loadUserByAssertion
protected UserDetails loadUserByAssertion(org.jasig.cas.client.validation.Assertion assertion)
アサーションに基づいて UserDetails を取得するためのテンプレートメソッド。デフォルトでは、構成された userDetailsService を呼び出してユーザー名を渡します。デプロイヤーはこのメソッドをオーバーライドし、任意の条件に基づいてユーザーを取得できます。- パラメーター:
assertion
- CAS アサーション。- 戻り値:
- UserDetails。
setUserDetailsService
public void setUserDetailsService(UserDetailsService userDetailsService)
setAuthenticationUserDetailsService
public void setAuthenticationUserDetailsService(AuthenticationUserDetailsService<CasAssertionAuthenticationToken> authenticationUserDetailsService)
setServiceProperties
public void setServiceProperties(ServiceProperties serviceProperties)
getKey
protected java.lang.String getKey()
setKey
public void setKey(java.lang.String key)
getStatelessTicketCache
public StatelessTicketCache getStatelessTicketCache()
getTicketValidator
protected org.jasig.cas.client.validation.TicketValidator getTicketValidator()
setMessageSource
public void setMessageSource(org.springframework.context.MessageSource messageSource)
- 次で指定:
- インターフェース
org.springframework.context.MessageSourceAware
のsetMessageSource
setStatelessTicketCache
public void setStatelessTicketCache(StatelessTicketCache statelessTicketCache)
setTicketValidator
public void setTicketValidator(org.jasig.cas.client.validation.TicketValidator ticketValidator)
setAuthoritiesMapper
public void setAuthoritiesMapper(GrantedAuthoritiesMapper authoritiesMapper)
supports
public boolean supports(java.lang.Class<?> authentication)
インターフェースからコピーされた説明:AuthenticationProvider
このAuthenticationProvider
が指定されたAuthentication
オブジェクトをサポートする場合、true
を返します。true
を返すことは、AuthenticationProvider
がAuthentication
クラスの提示されたインスタンスを認証できることを保証しません。それは、それがより詳細な評価をサポートできることを示しています。AuthenticationProvider
は、AuthenticationProvider.authenticate(Authentication)
メソッドからnull
を返して、別のAuthenticationProvider
を試す必要があることを示すことができます。認証を実行できる
AuthenticationProvider
の選択は、実行時にProviderManager
で行われます。- 次で指定:
- インターフェース
AuthenticationProvider
のsupports
- 戻り値:
- 実装が提示された
Authentication
クラスをより厳密に評価できる場合はtrue