JBoss SSO 允许跨安全域登录

时间:2021-04-09 13:35:58

标签: java jboss single-sign-on jboss-eap-7

美好的一天,

我无法让 JBoss EAP 7.2 与我的 SSO 配置一起工作。我在我的 standalone-full.xml 中配置了两个单独的安全域,并在我的 Undertow 配置中启用了单点登录路径 =“/”,但出于某种原因,如果我登录到一个安全域上的应用程序并导航到另一个安全域上的应用程序让我保持登录状态(即使我没有该应用程序的角色)。

这是一个细分:

  • sso 域上的 App1
  • sso 域上的 App2
  • ws 域上的 App3

登录 App1 工作,导航到 App2 工作(正确),导航到 App3 工作(不应该,因为它位于不同的安全域上,我没有该应用程序的角色)。

我注意到的一件事是它们共享相同的登录模块代码="UserLoginModule"。如果我更改一个或另一个以使用不同的登录模块,它似乎表现得像它应该的那样,但这对我的情况来说并不理想,除非这是我必须遵守的规则?如果是这种情况,请告诉我。

这是我的一些配置(如果您需要其他任何东西,请告诉我):

standalone-full.xml(安全域配置):

            <security-domain name="sso-domain" cache-type="default">
                <authentication>
                    <login-module code="UserLoginModule" flag="sufficient">
                        <module-option name="log" value="true"/>
                    </login-module>
                </authentication>
            </security-domain>
            <security-domain name="ws-domain" cache-type="default">
                <authentication>
                    <login-module code="UserLoginModule" flag="sufficient">
                        <module-option name="log" value="true"/>
                    </login-module>
                </authentication>
            </security-domain>

standalone-full.xml(Undertow 配置):

<subsystem xmlns="urn:jboss:domain:undertow:7.0" default-virtual-host="default-host">
        <buffer-cache name="default"/>
        <server name="default-server" default-host="default-host">
            <http-listener name="http" socket-binding="http" redirect-socket="https" enable-http2="true"/>
            <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
            <host name="default-host" alias="localhost,example.com">
                <location name="/" handler="welcome-content"/>
                <http-invoker security-realm="ApplicationRealm"/>
                <single-sign-on path="/"/>
            </host>
        </server>
        <servlet-container name="default">
            <jsp-config/>
            <websockets/>
        </servlet-container>
        <handlers>
            <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
        </handlers>
</subsystem>

jboss-web.xml - App1:

<jboss-web>
<context-root>/App1</context-root>
<security-domain flushOnSessionInvalidation="true">sso-domain</security-domain>
<replication-config>
    <replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>
    <replication-granularity>SESSION</replication-granularity>
</replication-config>
</jboss-web>

jboss-web.xml - App2:

<jboss-web>
<context-root>/App2</context-root>
<security-domain flushOnSessionInvalidation="true">sso-domain</security-domain>
<replication-config>
    <replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>
    <replication-granularity>SESSION</replication-granularity>
</replication-config>
</jboss-web>

jboss-web.xml - App3:

<jboss-web>
<context-root>/App3</context-root>
<security-domain flushOnSessionInvalidation="true">ws-domain</security-domain>
<replication-config>
    <replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>
    <replication-granularity>SESSION</replication-granularity>
</replication-config>
</jboss-web>

期待您分享的任何建议。提前致谢。

0 个答案:

没有答案