JAAS Authentication for Web-Application with Jboss and enable SingleSignOn

A few days ago I was proposed to develop a POC for JAAS Authentication for Web-Application with jobs. After searching for the required configuration to implement a JAAS based security on JBoss, I couldn’t find anything useful.

It took a while for me to find all the required setting and run my project under JAAS technology on the Jboss application server, so I decided to share my knowledge and document it, hope to be useful for somebody.

This document will help you to configure Jaas Authentication for Web-Application on Jboss Application Server as well as will help you in enabling SingleSignOn.

Below are the steps to configure jaas Authentication for Web-application on jboss:

Step-1: Define a new application policy in login-config.xml (C:\Software\jboss-4.2.3.GA\server\default\conf\login-config.xml)

To define an application policy, you need to modify login-config.xml to add the application policy: Below is the example policy.

<application-policy name = “web-console”>

<authentication>

<login-module code=”org.jboss.security.auth.spi.UsersRolesLoginModule”

flag = “required”>

<module-option name=”usersProperties”>props/web-console-users.properties</module-option>

<module-option name=”rolesProperties”>props/web-console-roles.properties</module-option>

</login-module>

</authentication>

</application-policy>

Add web-console-user.properties file in props folder (C:\Software\jboss-4.2.3.GA\server\default\conf\props) containing user and password information. Below is the example content in this file:

admin=admin

kumar=kumar

Add web-console-roles.properties file in props folder (C:\Software\jboss-4.2.3.GA\server\default\conf\props) containing user and role information. Below is the example content in this file:

admin=Administrator,user

kumar=user

Step-2: Create Security Domain

To define a security domain, you need to create a file named jboss‐web.xml in the

WEB‐INF directory of your web application.

Example of jboss‐web.xml:

<?xml version=”1.0″ encoding=”UTF-8″?>

<jboss-web>

<security-domain>java:/jaas/web-console</security-domain>

<context-root>/jaasTest</context-root>

</jboss-web>

web-console in the above example is the name of the defined application policy in the first

step.

Step-3: Secure the Application

In this step we secure the web application. For this we need to modify the web.xml file in the WEB‐INF directory.

These are changes need to apply to the web.xml file:

  1. Authentication: We should tell JBoss to authenticate users before allowing them to enter the application. This is done by adding <login‐config> element to the web.xml.

<login-config>

<auth-method>FORM</auth-method>

<realm-name>web-console</realm-name>

<form-login-config>

<form-login-page>/login.jsp</form-login-page>

<form-error-page>/login.jsp?error=yes</form-error-page>

</form-login-config>

</login-config>

In this example we tell JBoss that we need a form‐based authentication (redirects users to our own login form). login.jsp is the designed login page and if the authentication fails, users are redirected to loginfail.jsp.

  1. Create Login Page: Login page is a very simple JSP page with a form where the action of the form is set to j_security_check and a text box, j_username for username and apassword box, j_password for Password. For Example

<form method=”POST” action=”j_security_check”>

Login: <input type=”text” name=”j_username”><br/>

Passwort: <input type=”password” name=”j_password”><br/>

<input type=”submit” value=”Login”/>

</form>

  1. Secure Web Resources: Now we define our secured resources and required roles to access them. This is done by adding <security‐constraint> element to web.xml

<security-constraint>

<web-resource-collection>

<web-resource-name>CSF</web-resource-name>

<url-pattern>/*</url-pattern>

</web-resource-collection>

<auth-constraint>

<role-name>Administrator</role-name>

<role-name>user</role-name>

</auth-constraint>

</security-constraint>

In this example we are securing the entire pages of web-application.

Enable SingleSignOn on Jboss

SingleSignOn will help you in sharing user credential of one authenticated application to other applications that are deployed on same jboss server.

To enable SingleSignOn on jboss uncomment the following valve from server.xml (C:\Software\jboss-4.2.3.GA\server\default\deploy\jboss-web.deployer\server.xml)

<Valve className=”org.apache.catalina.authenticator.SingleSignOn” />

Thanks,

~Kumar

Leave a comment

Your comment

  • malte roger engagement
  • dons and bens
  • curtin ethical framework
  • name mathias kraft
  • richard snowden esq
  • muncie indaina dermatologist
  • defenition of creative arts
  • pouches
  • eileen
  • arts fest solomons md
  • certificates
  • high gloss rocks
  • downing
  • silvana dix
  • conclusa designed by phpbb
  • antonym of gawk
  • taurus 1911 malfunction magazine
  • performance boxer briefs
  • fudge
  • chips
  • msds for ammonium phosphate
  • gwendoline cram old perlican
  • displacement
  • weymouth yesterday temperature
  • malaga island maine
  • breitling chrono avenger prices
  • multinational companies in trinidad
  • robert l foote thyroid
  • traveler hook
  • tudra biome advantages
  • strategies
  • pictures of pecans walnuts
  • un segundo de paz
  • oregon solicitation laws
  • pharos science gps
  • ixtapa bayview grand rentals
  • used fire apparatus sales
  • 135 ludlow northvale
  • covering letters freee stuff
  • lisa marie pressley tmz
  • natural foods jessup maryland
  • answers please
  • latest hilary duff song
  • 2000 alero remote
  • ethel wicke iowa
  • abrahams lincolns life
  • matches
  • national wireing color code
  • hombres usan aretes
  • pennslyvania cencus
  • pyramid
  • ssis runtime oledb connection
  • johnstown
  • chicco canada
  • tube by elias chatzoudis
  • barra macneils the
  • hedwig k nig
  • ged waynesville missouri
  • top eyewear in seattle
  • hunting hounds for sale
  • bursitis spelling
  • maidstone hospital address
  • flexibility for dancers
  • sanjuanita cardenas sentence
  • using hard anodized cookware
  • trybuilt chipper shreder
  • suture technique
  • baja fresh franchises information
  • mc kinney texas hospital
  • dentzel carousel horse history
  • ukraine
  • quintana roo rehab centers
  • sybil identity revealed
  • bestar granite graphite 4500
  • hypothalamus and cortisol
  • kauai
  • mitzi lafarga
  • human resouces jobs
  • sophia loren soldi
  • boon wah hotel
  • cherish the child
  • purgatory chasms
  • restrictions on proprietary code
  • higgins
  • tom calhoun portland
  • novel by marilyn halverson
  • teen storie about dating
  • livin gluten free
  • wd boyce council bsa
  • wendys closing
  • saber motorcycle helmets
  • senor ferrari 1942 casablanca
  • daddys poem
  • aprendizaje conductista
  • dilution
  • kalle anka video
  • couplers
  • golden gophers apparel
  • navi honda hacks
  • benoit northeast hunter magazine
  • saidi bellydance costume
  • vrbo around yellowstone no
  • r b musc listing
  • el campo inn
  • towler shaw roberts wolverhampton
  • audobon society central florida
  • baghdad
  • utility locating software
  • readily available biographical information
  • entrance
  • ryland homes fargo
  • tanja schmitz
  • through the pouring rain
  • bases plural of basis
  • lifespan development flash cards
  • crazy
  • scott monahan motorcycle
  • classic cajun rialto california
  • armani exhange uk shops
  • fairfield illinois broadband internet
  • gravity fed racks
  • glaser
  • clair
  • 25th infantry division coin
  • panda express restruant
  • docking windows
  • connected vehicle proving center
  • romana guenzi
  • malcolm robb west australia
  • lifecycle of blowfly
  • robert theodore stafford said
  • quantas brisbane airport
  • knitting argyl vest pattern
  • english pubs in seattle
  • dislocated shoulder complictions
  • century 21 chillicothe mo
  • nukem die for
  • beauport guadeloupe population
  • recovery mobility formula
  • fusion sabot slugs
  • coiled solar panels
  • interchangeable
  • stronghold 2 data
  • bombs over bagdah
  • best cucumber sandwich
  • tonya lacy model
  • street addresses from ips
  • elastic goods
  • cold chocolate souffle recipes
  • disconnect
  • sejarah lari sambung
  • marine fishes wallpaper
  • hope diamond located where
  • burgers
  • zino sumatra classic
  • gastonia apartment finder
  • 1885
  • sort
  • thomson mp231 players
  • hotspots in eindhoven
  • pesticide regulation product chemistry
  • gates
  • jame
  • texas meatloaf recipe
  • cherokee
  • stairway
  • teaching elementary classroom management
  • betty coker price
  • boyfriend
  • avengers heroes reborn
  • genuine flan recipes
  • veronica da souza pics
  • slippers for toddlers
  • kolb cycle of learning
  • vina herminia excelsus
  • belmont
  • art as symbolic form
  • spca in coquitlam
  • internal
  • bavarian summer festival
  • jorge hank rodolfo valdes
  • life expectancy green algae
  • lillie allen smile
  • castle marne inn denver
  • wimax hotspots in lisbon
  • mathew reilly novels
  • compatibility mode for itunes
  • haller foundation
  • scripps ranch contact lenses
  • miguel cotto interview
  • penrose brain quantum
  • hydrocarbon products
  • dram manufacturing explained
  • rich homeless people
  • onngaleah s huff realty
  • connor
  • hariet tubman for kids
  • knife sharpening systems