我有一个Wildfly 11的新实例,在这里我试图在Elytron中设置基于属性文件的身份验证。我正在使用Standalone-full.xml并在IDE外部手动部署应用程序。
https://docs.jboss.org/author/display/WFLY/Properties+File+Based+Authentication+Migration
我使用名称值对创建了myApp-user和myApp-roles属性文件,并包含#$ REALM_NAME = myAppPropRealm $
我运行了以下CLI命令来创建
/ subsystem = elytron / properties-realm = myAppPropRealm:add(groups-attribute = groups,groups-properties = {path = myApp-roles.properties,relative-to = jboss.server.config.dir},用户- properties = {path = myApp-users.properties,relative-to = jboss.server.config.dir,plain-text = true})
/ subsystem = elytron / security-domain = myAppSecurityDomain:add(realms = [{{realm = myAppPropRealm,role-decoder = groups-to-roles}],default-realm = myAppPropRealm,permission-mapper = default-permission-映射器)
/ subsystem = elytron / http-authentication-factory = myApp-http-auth:add(http-server-mechanism-factory = global,security-domain = myAppSecurityDomain,mechanism-configurations = [{{mechanism-name = BASIC, mechanism-realm-configurations = [{{realm-name = myApp_ApplicationDomain}]}]))
/ subsystem = undertow / application-security-domain = myApp_ApplicationDomain:add(http-authentication-factory = myApp-http-auth)
JBoss-web.xml
</jboss-web>
<security-domain>myApp_ApplicationDomain</security-domain>
</jboss-web>
我的应用程序尝试部署时出现以下错误
2018-11-29 09:06:55,695错误[org.jboss.as.controller.management-operation](控制器引导线程)WFLYCTL0013:操作(“ deploy”)失败-地址:([(“ deployment” =>“ MyApplication-ws.war”)])-失败描述:{ “ WFLYCTL0412:未安装的必需服务:” => [“ jboss.security.security-domain.myApp_ApplicationDomain”], “ WFLYCTL0180:缺少依赖项/不可用的服务” => [
我怀疑这是因为我没有定义'myApp_ApplicationDomain',但这是我遇到的问题。我运行哪些命令来添加/引用 myApp_ApplicationDomain?
答案 0 :(得分:0)
由于某些原因,Wildfly正在寻找旧版安全域jboss.security.security-domain.myApp_ApplicationDomain。但似乎您已在undertow中正确声明了myApp_ApplicationDomain。最可能是您在undertow子系统之外的某个地方使用了myApp_ApplicationDomain。