首页 > 解决方案 > JBoss jaas 会话超时

问题描述

我想在 JBoss EAP 7.1.0 中设置 jaas 会话超时。我定义了新的安全域:

<security-domain name="management" cache-type="infinispan">
    <authentication>
        <login-module code="RealmDirect" flag="required">
            <module-option name="realm" value="ManagementRealm"/>
        </login-module>
    </authentication>
</security-domain>

我修改了 infinispan 以设置会话超时:

<cache-container name="security" default-cache="auth-cache">
    <local-cache name="auth-cache">
        <eviction strategy="LRU" max-entries="1000"/>
        <expiration lifespan="120000" max-idle="60000"/>
    </local-cache>
</cache-container>

但是,我的 jaas 会话永不过期。在我的应用程序中,我有:

<login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>ManagementRealm</realm-name>
</login-config>

而且我的 jboss-web.xml 定义了安全域:

<security-domain>management</security-domain>

JBoss 只要求我输入一次密码,然后它会缓存,因此不再显示登录对话框。

标签: jakarta-eejbossjboss7.xjaas

解决方案


您可能必须将本地缓存名称设置为安全域的名称。

<local-cache name="management">  

推荐阅读