• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Configure DB Login Module in JBoss

Configure DB Login Module in JBoss

Add to conf/login-config.xml:

  • <application-policy name=”MyPolicy”>
  • <authentication>
  • <login-module flag=”required” code=”org.jboss.security.auth.spi.DatabaseServerLoginModule”>
  • <module-option name=”dsJndiName”>java:/AuthorityDB</module-option>
  • <module-option name=”principalsQuery”>SELECT Password FROM Users WHERE Username=?</module-option>
  • <module-option name=”rolesQuery”>SELECT Rolename, “Roles” FROM Roles WHERE Username=?</module-option>
  • </login-module>
  • </authentication>
  • </application-policy>

Application policy name declares a new policy. We will reference this name in each [web] application that wishes to use it.

Interested in mastering JBOSS? Learn more about JBOSS Tutorial in this blog post.

The required flag means that the login module is required to succeed.

If it succeeds or fails, authentication still continues to proceed down the LoginModule list

Other options are: requisite, sufficient, and optional

Module option dsJndiName:

Defines the JNDI name of the RDBMS DataSource that defines logical users and roles tables

Defaults to java:/DefaultDS

Module option principalsQuery:

Defines a prepared SQL statement that queries the password of a given username

Defaults to select Password from Principals where PrincipalID=?

Module option rolesQuery:

Defines a prepared SQL statement that queries role names (and groups) of a given username

The default group name is Roles (hard-coded). Defaults to select Role, RoleGroup from Roles where PrincipalID=?

For indepth understanding on JBoss click on:

Review Date
Reviewed Item
Configure DB Login Module in JBoss
Author Rating

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Configure DB Login Module in JBoss"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.