如何在Elytron Wildfly 26.1中定义自定义主要类别?

发布于 2025-01-31 21:39:21 字数 881 浏览 3 评论 0原文

在旧版系统中,使用专用登录模块,并在应用程序使用的安全域中定义的自定义主体类,例如以下(JBOSS 7.2)(JBOSS 7.2)

    <subsystem xmlns="urn:jboss:domain:security:1.2">
        <security-domains>
            <security-domain name="other-security-domain" cache-type="default">
                <authentication>
                    <login-module code="com.xxx.OtherLoginModule" flag="requisite">
                        <module-option name="password-stacking" value="useFirstPass"/>
                        <module-option name="principalClass" value="com.xxx.OtherPrincipal"/>
                    </login-module>

如何在Wildfly 26.1/Elytron上完成相应的配置? 我浏览了文档26.1/wildfly_elytron_security(特别是第18章。将传统安全性迁移到Elytron Security'),但没有找到解决方案。

其他问题:

  • 文档指向子系统安全/安全域,但是在CLI中,我只看到安全管理(无法基于该文档运行Legacy JAAS模块),
  • 没有任何示例与自定义主体类(基本问题)

In legacy system is used dedicated login-module with custom principal class defined in security domain used by application, like below (JBoss 7.2)

    <subsystem xmlns="urn:jboss:domain:security:1.2">
        <security-domains>
            <security-domain name="other-security-domain" cache-type="default">
                <authentication>
                    <login-module code="com.xxx.OtherLoginModule" flag="requisite">
                        <module-option name="password-stacking" value="useFirstPass"/>
                        <module-option name="principalClass" value="com.xxx.OtherPrincipal"/>
                    </login-module>

How the corresponding configuration should be done on Wildfly 26.1/Elytron ?
I looked through the documentation 26.1/WildFly_Elytron_Security, (in particular, chapter '18. Migrate Legacy Security to Elytron Security') but found no solution.

Additional problems:

  • documentation point to subsystem security/security-domain but in CLI i see only security-management (can't run legacy jaas module based on that doc)
  • no any example with custom principal class (base problem)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

四叶草在未来唯美盛开 2025-02-07 21:39:21

如果可能的话,应将登录模块迁移到现有的安全领域,如果不是选项,则可以实现博客。最后一个选项是使用所描述的Jaas-realm 在这里

对于自定义校长,根据您的用例,可能是不可能的,请参阅此未解决的问题 https ://issues.redhat.com/browse/wfcore-5809

但是,可以取而代之的是配置 SecurityIdentity 的属性,其中您要存储在主体中的信息。然后,您可以在应用程序中使用 method securityDomain.getCurrent()。getCurrentsecurentsecurityNidentity()。getAttributes()。。根据您的用例,这可能是另一种选择。

the login modules should be migrated to an existing security realms if possible, if that is not an option you can implement a custom security realm like mentioned in this blog . Last option is using jaas-realm described here.

For the custom principal, depending on your use case, it might not be possible, see this unresolved issue https://issues.redhat.com/browse/WFCORE-5809 .

But it is possible to instead configure SecurityIdentity's attributes with the information you want to store in the principal. Then you can obtain these security identity attributes in your application with the method SecurityDomain.getCurrent().getCurrentSecurityIdentity().getAttributes(). Depending on your use case this might be an alternative.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文