Tell me how to configure.
It gives an error that the user does not exist.
Does anyone have a working version?
Everything seems to be set up as described.

web.xml all spelled out (everything works on GlashFish ).
Base created, users added, roles created.
Connect with base OK .

jboss-web.xml

 <jboss-web> <security-domain>java:/jaas/secureDomain</security-domain> </jboss-web> 

standalone.xml

 <security-domain name="secureDomain" cache-type="default"> <authentication> <login-module code="Database" flag="required"> <module-option name="dsJndiName" value="java:jboss/datasourc es/UserDS"/> <module-option name="principalsQuery" value="select passwd f rom Users where username=?"/> <module-option name="rolesQuery" value="select role, 'Roles' from UserRoles where username=?"/> <module-option name="hashAlgorithm" value="SHA-256"/> <module-option name="hashEncoding" value="base64"/> </login-module> </authentication> </security-domain> 
  • And you have a space in the query on the word FROM (select passwd f rom Users where username =?) - cache

1 answer 1

The problem is in the jboss-web.xml file. That would work in Wildfly 8.

 <jboss-web> <security-domain>java:/jaas/secureDomain</security-domain> </jboss-web> 

In Wildfly, starting from version 9, the Security Domain declared without the java:/jaas/ prefix java:/jaas/

 <?xml version="1.0" encoding="UTF-8"?> <jboss-web> <security-domain>secureDomain</security-domain> </jboss-web>