クラス DefaultJaasAuthenticationProvider
- java.lang.Object
-
- org.springframework.security.authentication.jaas.AbstractJaasAuthenticationProvider
-
- org.springframework.security.authentication.jaas.DefaultJaasAuthenticationProvider
- 実装済みのインターフェース一覧:
java.util.EventListener、org.springframework.beans.factory.Aware、org.springframework.beans.factory.InitializingBean、org.springframework.context.ApplicationEventPublisherAware、org.springframework.context.ApplicationListener<SessionDestroyedEvent>、AuthenticationProvider
public class DefaultJaasAuthenticationProvider extends AbstractJaasAuthenticationProvider
提供された構成を使用して LoginContext を作成します。これにより、
Configuration.getConfiguration()の値に関係なく構成を挿入できます。特定の構成実装にバインドされていませんが、JAAS 構成のメモリ内バージョンは
InMemoryConfigurationを使用して表すことができます。次の JAAS 構成:
SPRINGSECURITY { sample.SampleLoginModule required; };次のように表すことができます。
<bean id="jaasAuthProvider" class="org.springframework.security.authentication.jaas.DefaultJaasAuthenticationProvider"> <property name="configuration"> <bean class="org.springframework.security.authentication.jaas.memory.InMemoryConfiguration"> <constructor-arg> <map> <!-- SPRINGSECURITY is the default loginContextName for AbstractJaasAuthenticationProvider--> <entry key="SPRINGSECURITY"> <array> <bean class="javax.security.auth.login.AppConfigurationEntry"> <constructor-arg value="sample.SampleLoginModule" /> <constructor-arg> <util:constant static-field="javax.security.auth.login.AppConfigurationEntry$LoginModuleControlFlag.REQUIRED" /> </constructor-arg> <constructor-arg> <map></map> </constructor-arg> </bean> </array> </entry> </map> </constructor-arg> </bean> </property> <property name="authorityGranters"> <list> <!-- You will need to write your own implementation of AuthorityGranter --> <bean class="org.springframework.security.authentication.jaas.TestAuthorityGranter"/> </list> </property> </bean>
フィールド概要
クラス org.springframework.security.authentication.jaas.AbstractJaasAuthenticationProvider から継承されたフィールド
log
コンストラクター概要
コンストラクター コンストラクター 説明 DefaultJaasAuthenticationProvider()
方法の概要
すべてのメソッド インスタンスメソッド 具象メソッド 修飾子と型 メソッド 説明 voidafterPropertiesSet()必要なプロパティが設定されていることを検証します。protected javax.security.auth.login.LoginContextcreateLoginContext(javax.security.auth.callback.CallbackHandler handler)setConfiguration(Configuration)で指定された構成を使用して LoginContext を作成します。protected javax.security.auth.login.ConfigurationgetConfiguration()voidsetConfiguration(javax.security.auth.login.Configuration configuration)認証に使用する構成を設定します。クラス org.springframework.security.authentication.jaas.AbstractJaasAuthenticationProvider から継承されたメソッド
authenticate, getApplicationEventPublisher, handleLogout, onApplicationEvent, publishFailureEvent, publishSuccessEvent, setApplicationEventPublisher, setAuthorityGranters, setCallbackHandlers, setLoginContextName, setLoginExceptionResolver, supports
メソッドの詳細
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exceptionクラスからコピーされた説明:AbstractJaasAuthenticationProvider必要なプロパティが設定されていることを検証します。さらに、AbstractJaasAuthenticationProvider.setCallbackHandlers(JaasAuthenticationCallbackHandler[])が有効なハンドラーで呼び出されていない場合は、JaasNameCallbackHandlerおよびJaasPasswordCallbackHandlerを使用するように初期化します。- 次で指定:
- インターフェース
org.springframework.beans.factory.InitializingBeanのafterPropertiesSet - オーバーライド:
- クラス
AbstractJaasAuthenticationProviderのafterPropertiesSet - 例外:
java.lang.Exception
createLoginContext
protected javax.security.auth.login.LoginContext createLoginContext(javax.security.auth.callback.CallbackHandler handler) throws javax.security.auth.login.LoginExceptionsetConfiguration(Configuration)で指定された構成を使用して LoginContext を作成します。- 次で指定:
- クラス
AbstractJaasAuthenticationProviderのcreateLoginContext - パラメーター:
handler- LoginContext に使用する必要がある CallbackHandler(非null)。- 戻り値:
- 認証に使用する LoginContext
- 例外:
javax.security.auth.login.LoginException
getConfiguration
protected javax.security.auth.login.Configuration getConfiguration()
setConfiguration
public void setConfiguration(javax.security.auth.login.Configuration configuration)
認証に使用する構成を設定します。- パラメーター:
configuration-createLoginContext(CallbackHandler)が呼び出されたときに使用される構成。