Setting up JAAS security in JBOSS AS 7
joydevsingha Sep 16, 2011 3:39 AMHi,
I was using JBOSS 4.2 for my application and now migrating to JBOSS AS 7.
In JBOSS 4.2 the security was configured as follows (the files are attached), I was using "org.jboss.security.auth.login.DynamicLoginConfig" for security.
exampleapp-login-config.xml was present in JBOSS_HOME/server/default/conf
and
exampleapp-login-config-service.xml was present in JBOSS_HOME/server/default/deploy
I found that in JBOSS AS 7 the configuration was required to be done standalone.xml file, so I added the below lines
<security-domain name="wealthatlas-security-domain" cache-type="default">
<authentication>
<login-module code="com.equilar.wealthatlas.security.WealthAtlasLoginModule" flag="required">
<module-option name="maxInvalidLoginAttempts">5</module-option>
<module-option name="dataSourceName">java:/WealthAtlasDS</module-option>
<module-option name="passwordKey">bc2ead7b8c58702d62ca1416</module-option>
</login-module>
</authentication>
</security-domain>
But server was throwing errors when ear was deployed.
11:59:44,525 ERROR [stderr] Exception in thread "Controller Boot Thread" java.lang.RuntimeException: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to parse configuration
11:59:44,526 ERROR [stderr] at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:89)
11:59:44,526 ERROR [stderr] at java.lang.Thread.run(Unknown Source)
11:59:44,526 ERROR [stderr] Caused by: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to parse configuration
11:59:44,527 ERROR [stderr] at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:115)
11:59:44,527 ERROR [stderr] at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:104)
11:59:44,527 ERROR [stderr] at org.jboss.as.server.ServerService.boot(ServerService.java:193)
11:59:44,528 ERROR [stderr] at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:83)
11:59:44,528 ERROR [stderr] ... 1 more
11:59:44,528 ERROR [stderr] Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[262,8]
11:59:44,528 ERROR [stderr] Message: Missing required attribute(s): value
Can anybody please advice how can I do the similar setting in JBOSS AS 7. The xml files are attached.
-
exampleapp-login-config-service.xml 513 bytes
-
exampleapp-login-config.xml 630 bytes