首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何将遗留登录模块迁移到jaas-领域

如何将遗留登录模块迁移到jaas-领域
EN

Stack Overflow用户
提问于 2022-10-04 12:36:15
回答 1查看 205关注 0票数 0

我试图找到一种方法将我们的安全解决方案从WildFly 22迁移到WildFly 26,在那里不再支持带有自定义登录模块的遗留方式。例如,我发现这篇博客文章https://wildfly-security.github.io/wildfly-elytron/blog/jaas-realm/建议使用jaas-领域,但我无法将其配置为诚实。

如果我想迁移这个例子,我应该做什么呢?这在WildFly的早期版本中是这样定义的:

代码语言:javascript
运行
复制
<security-domain name="my-form-auth" cache-type="default">
  <authentication>
    <login-module name="FirstLoginModule" code="my.first.lm.FirstLoginModule" flag="sufficient">
      <module-option name="config.filename" value=".first_lm_props" />
    </login-module>
    <login-module name="SecondLoginModule" code="my.second.lm.SecondLoginModule" flag="sufficient">
      <module-option name="config.filename" value=".second_lm_props" />
    </login-module>
  </authentication>
</security-domain>

WildFly可以使用这些登录模块的实际代码作为已部署应用程序的依赖项。

到目前为止,我设法像这样设置了WildFly 26的配置(使用基本场景--只有一个登录模块):

代码语言:javascript
运行
复制
         <security-domains>
            ...
            <security-domain name="mySD" default-realm="myJaasRealm" permission-mapper="default-permission-mapper">
                <realm name="myJaasRealm"/>
            </security-domain>
        </security-domains>
        <security-realms>
            ...
            <jaas-realm name="myJaasRealm" entry="myEntry" module="my.module.with.lm">
                <file path="D:\APP\Wildfly\wildfly-26.0.1.Final\bin\elytron\JAAS-login-module.conf"/>
            </jaas-realm>
        </security-realms>
....
        <http>
            <http-authentication-factory name="example-loginconfig-http-auth" security-domain="mySD" http-server-mechanism-factory="global">
                <mechanism-configuration>
                    <mechanism mechanism-name="FORM">
                        <mechanism-realm realm-name="myJaasRealm"/>
                    </mechanism>
                </mechanism-configuration>
            </http-authentication-factory>
        </http>

....
<subsystem xmlns="urn:jboss:domain:undertow:12.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
        ...
        <application-security-domains>
            <application-security-domain name="other" http-authentication-factory="example-loginconfig-http-auth"/>
        </application-security-domains>
</subsystem>

JAAS-登录-module.conf:

代码语言:javascript
运行
复制
MyEntry {
  my.first.lm.FirstLoginModule sufficient;
};

JBos-web.xml:

代码语言:javascript
运行
复制
<jboss-web>
  <context-root>${context-root}</context-root>
  <security-domain>other</security-domain>
</jboss-web>

尽管如此,我还是无法让它发挥作用。

EN

回答 1

Stack Overflow用户

发布于 2022-11-15 11:10:58

代码语言:javascript
运行
复制
<jboss-web>
  <context-root>${context-root}</context-root>
  <security-domain>mySD</security-domain>
</jboss-web>

在web.xml中,您还必须配置您的领域名称,如

代码语言:javascript
运行
复制
<login-config>
    <auth-method>FORM</auth-method>
    <realm-name>myJaasRealm</realm-name>
</login-config>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73947956

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档