2.4.3. 使用 JAAS 保护管理接口


JAAS 是 JBoss EAP 用于管理安全性的声明式安全 API。有关 JAAS 和声明性安全性的详情和背景,请参阅红帽 JBoss 企业应用平台安全架构指南中 https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.3/html-single/security_architecture/#declarative_security_and_jaas 的声明安全性和 JAAS 部分。

注意

当 JBoss EAP 实例配置为在ADMIN_ONLY 模式中运行时,不支持使用 JAAS 来保护管理接口。如需有关ADMIN_ONLY 模式的更多信息,请参阅 JBoss EAP 配置指南的 ADMIN_ONLY 模式中运行 JBoss EAP 部分

要使用 JAAS 在管理接口中进行身份验证,必须执行以下步骤:

  1. 创建安全域.

    在本例中,使用 UserRoles 登录模块创建了一个安全域,但也可以使用其他登录模块:

    /subsystem=security/security-domain=UsersLMDomain:add(cache-type=default)
    
    /subsystem=security/security-domain=UsersLMDomain/authentication=classic:add
    
    /subsystem=security/security-domain=UsersLMDomain/authentication=classic/login-module=UsersRoles:add(code=UsersRoles, flag=required,module-options=[("usersProperties"=>"users.properties"),("rolesProperties"=>"roles.properties")])
    Copy to Clipboard Toggle word wrap
  2. 创建具有 JAAS 身份验证的安全域。

    /core-service=management/security-realm=SecurityDomainAuthnRealm:add
    
    /core-service=management/security-realm=SecurityDomainAuthnRealm/authentication=jaas:add(name=UsersLMDomain)
    Copy to Clipboard Toggle word wrap
  3. 更新 http-interface 管理接口以使用新的安全域。

    /core-service=management/management-interface=http-interface/:write-attribute(name=security-realm,value=SecurityDomainAuthnRealm)
    Copy to Clipboard Toggle word wrap
  4. 可选:分配组成员资格

    属性 assign-groups 确定是否将来自安全域的用户成员资格信息用于安全域中的组分配。当设置为 true 时,此组分配用于基于角色的访问控制(RBAC)。

    /core-service=management/security-realm=SecurityDomainAuthnRealm/authentication=jaas:write-attribute(name=assign-groups,value=true)
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat