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>
log| コンストラクターと説明 |
|---|
DefaultJaasAuthenticationProvider() |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | afterPropertiesSet() 必要なプロパティが設定されていることを検証します。 |
protected javax.security.auth.login.LoginContext | createLoginContext(javax.security.auth.callback.CallbackHandler handler)setConfiguration(Configuration) で指定された構成を使用して LoginContext を作成します。 |
protected javax.security.auth.login.Configuration | getConfiguration() |
void | setConfiguration(javax.security.auth.login.Configuration configuration) 認証に使用する構成を設定します。 |
authenticate, getApplicationEventPublisher, handleLogout, onApplicationEvent, publishFailureEvent, publishSuccessEvent, setApplicationEventPublisher, setAuthorityGranters, setCallbackHandlers, setLoginContextName, setLoginExceptionResolver, supportspublic void afterPropertiesSet()
throws java.lang.ExceptionAbstractJaasAuthenticationProviderAbstractJaasAuthenticationProvider.setCallbackHandlers(JaasAuthenticationCallbackHandler[]) が有効なハンドラーで呼び出されていない場合は、JaasNameCallbackHandler および JaasPasswordCallbackHandler を使用するように初期化します。org.springframework.beans.factory.InitializingBean 内の afterPropertiesSet AbstractJaasAuthenticationProvider の afterPropertiesSet java.lang.Exceptionprotected 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)。javax.security.auth.login.LoginExceptionprotected javax.security.auth.login.Configuration getConfiguration()
public void setConfiguration(javax.security.auth.login.Configuration configuration)
configuration - createLoginContext(CallbackHandler) が呼び出されたときに使用される構成。