5 Replies Latest reply: Nov 13, 2013 12:03 AM by Hrishi Salvi RSS

Jboss Negotiation fallback to login page if NTLM token is received or the user is not present in active directory.

Hrishi Salvi Newbie

Problem Description:

We are trying to configure the single sign on using jboss negotiation.
We are able to login successfully if the user is present in active directory.
But in case if user is not present in active directory users, it throw 401 error page.
Instead of 401 we want user to access login form and authenticate user using different login module.

In our case we have login page we authenticate user on that page.
If we receive user credentials we login the user without asking for password.
Now if the user credentials are not received then we want user to open login form present
on login page, but before that is throws 401 error.

We have configure the login-config.xml, web.xml and jboss-web.xml as per the documentation.
Also defined
in web.xml

Our application is access through Request servlet.

Steps to Reproduce:



edit web.xml as


















edit jboss-web.xml




edit login-config.xml

<application-policy name="host">


      <login-module code="com.sun.security.auth.module.Krb5LoginModule"


         <module-option name="storeKey">true</module-option>

         <module-option name="useKeyTab">true</module-option>

<module-option name="principal">%princpal%</module-option>

         <module-option name="keyTab">%keytab path%</module-option>

         <module-option name="doNotPrompt">true</module-option>

         <module-option name="debug">true</module-option>





<application-policy name="SPNEGO">


      <login-module code="org.jboss.security.negotiation.spnego.SPNEGOLoginModule">

         <module-option name="password-stacking">useFirstPass</module-option>

         <module-option name="serverSecurityDomain">host</module-option>








hit login page with the user authenticated using active directory you will be able to login.



Now hit login page with user that is not present in active directory



401 error thrown.

Instead of 401 user should be able to view login form.


Note:We are using JBoss 6.1, Jboss Negotiation Version: 2.1.0.GA which is by default shipped with Jboss 6.1, we have not made any changes in jar.