クラス DefaultJaasAuthenticationProvider

java.lang.ObjectSE
org.springframework.security.authentication.jaas.AbstractJaasAuthenticationProvider
org.springframework.security.authentication.jaas.DefaultJaasAuthenticationProvider
実装済みのインターフェース一覧:
EventListenerSE, 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>
関連事項: