Friday, April 5, 2013

JBOSS Login module tutorial



STEP 1
Jsp login form

  • set form action as j_security_check
  • set user ID text field name as j_username
  • set password text field name as j_password
login.jsp


STEP 2
Set security area of the web application in web.xml file
Hear we are defined separate secured url patten such as http://www.localhost/test-login/secure/home.jsp  .

This mean request which comes with url patten like http://www.localhost/test-login/secure/* only could access for successfully log-in users.


/WEB-INF/web.xml

In the login-config.xml it should be mention
  • login-relam name
  • login form url
  • login error url

STEP 3
Add jboss-web.xml in WEB-INF folder in project

/WEB-INF/jboss-web.xml

STEP 4
JBOSS Configuration

Add new application policy on log-config.xml. Hear
  • TESTLoginRealm – login-relam name
  • test_datasource – Datasource name which has created on test_ds.xml in deploy directory
  • principalsQuery – This query should return password of the user
/default/conf/login-config.xml


No comments:

Post a Comment