-
1. Re: How to configure DatabaseLoginModule for DIGEST authentication?
michajil_tigrow Oct 4, 2012 7:26 AM (in response to michajil_tigrow)Ok, I've manage to solve my problem partially.
At first I switched to the different login module just to understand how this should be done, and this thread helped me a lot https://community.jboss.org/message/744521
So, I had to change the way I encrypt passwords in my db - now they're encrypted the same way RFC2617Digest does it. After that it was simple, I just reused the solution from the above thread with little modifications just to use the db login module.
{code:xml}
<login-module code="Database" flag="required">
<module-option name="dsJndiName" value="..." />
<module-option name="principalsQuery"
value="SELECT password FROM .." />
<module-option name="rolesQuery"
value="SELECT role.name as Role, 'Roles' FROM ..." />
<module-option name="hashAlgorithm" value="MD5"/>
<module-option name="hashEncoding" value="RFC2617"/>
<module-option name="hashUserPassword" value="false"/>
<module-option name="hashStorePassword" value="true"/>
<module-option name="passwordIsA1Hash" value="true"/>
<module-option name="storeDigestCallback" value="org.jboss.security.auth.callback.RFC2617Digest"/>
</login-module>
{code}