Java中的WildFly 12基于表单的身份验证

时间:2018-06-18 19:34:47

标签: java spring authentication jboss wildfly

我正在尝试使用WildFly 12作为我的服务器在我的Java Web应用程序中启用基于表单的身份验证。当我启动服务器WildFly在我的standalone.xml上窒息。我用来帮助创建它的例子都来自早于12的WildFly版本,所以我假设语法已经改变。有人能帮帮我吗?

standalone.xml: security-domains node

<security-domains>
                <security-domain name="FBADomain">
                    <authentication>
                        <login-module code="Database" flag="required">
                            <module-option name="dsJndiName" value="java:/PostgresDS"/>
                            <module-option name="principalsQuery" value="SELECT password FROM users WHERE username=?" />
                            <module-option name="rolesQuery" value="SELECT role, 'Roles' FROM user_roles WHERE username=?" />
                        </login-module>
                    </authentication>
                </security-domain>


                <security-domain name="ApplicationDomain" default-realm="ApplicationRealm" permission-mapper="default-permission-mapper">
                    <realm name="ApplicationRealm" role-decoder="groups-to-roles"/>
                    <realm name="local"/>
                </security-domain>
                <security-domain name="ManagementDomain" default-realm="ManagementRealm" permission-mapper="default-permission-mapper">
                    <realm name="ManagementRealm" role-decoder="groups-to-roles"/>
                    <realm name="local" role-mapper="super-user-mapper"/>
                </security-domain>
            </security-domains>

这是来自控制台的wildfly错误:

15:02:27,686 INFO  [org.jboss.modules] (main) JBoss Modules version 1.7.0.Final
15:02:27,991 INFO  [org.jboss.msc] (main) JBoss MSC version 1.3.2.Final
15:02:28,000 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.1.Final
15:02:28,108 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 12.0.0.Final (WildFly Core 4.0.0.Final) starting
15:02:29,292 ERROR [org.jboss.as.controller] (Controller Boot Thread) 

OPVDX001: Validation error in standalone.xml -----------------------------------
|
|  248:     <security-domains>
|  249: <security-domain name="FBADomain">
|  250:             <authentication>
|                   ^^^^ 'authentication' isn't an allowed element here
|                        
|                        Elements allowed here are: realm 
|
|  251:     <login-module code="Database" flag="required">
|  252:       <module-option name="dsJndiName" value="java:/PostgresDS"/>
|  253:       <module-option name="principalsQuery" value="SELECT password FROM users WHERE username=?" />
|
| The primary underlying error message was:
| > ParseError at [row,col]:[250,21]
| > Message: WFLYCTL0198: Unexpected element
| >   '{urn:wildfly:elytron:2.0}authentication' encountered
|
|-------------------------------------------------------------------------------

15:02:29,294 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:143)
    at org.jboss.as.server.ServerService.boot(ServerService.java:377)
    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:372)
    at java.lang.Thread.run(Thread.java:745)

15:02:29,295 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
15:02:29,305 INFO  [org.jboss.as] (MSC service thread 1-4) WFLYSRV0050: WildFly Full 12.0.0.Final (WildFly Core 4.0.0.Final) stopped in 5ms

0 个答案:

没有答案