cancel
Showing results for 
Search instead for 
Did you mean: 

JAAS authentication in WAS

Former Member
0 Kudos

Hi,

I am trying to authenticate using <b>JAAS</b> on <b>WAS</b> through <b>LDAP</b>. I created my own login module following the steps in the guide. Specified my web application to the login module and deployed everything. I get <b>LoginException</b> everytime I try to login. When i debugged and peeked through the <b>LoginContext</b> class, I found out that my login module is called correctly and it also authenticate through LDAP correctly. But after executing the <b>login(</b>) method of the login module, i didnt see the <b>commit()</b> method getting called and somewhere in the JAAS somehow the <b>LoginException</b> is thrown which I am unable to find where?

Does anyone have any clue to where should I look?

Thanks

Faraz

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

any solution to this?

Former Member
0 Kudos

The code below throws the LoginException after calling the <b>invokeModule(LOGIN_METHOD)</b>. Even though the login function in the login module authenticates the user and returns with a <b>"true"</b> without any exception.

<u>P.S.: This is standard JAAS LoginContext class decompiled!</u>

<u><b>LoginContext Class:</b></u>

public void <b>login()</b> throws LoginException {
	loginSucceeded = false;
	if (subject == null) {
	    subject = new Subject();
	}
	try {
	    <b>invokeModule(LOGIN_METHOD);</b>
	    invokeModule(COMMIT_METHOD);
	    loginSucceeded = true;
	} catch (LoginException le) {
	    try {
		invokeModule(ABORT_METHOD);
	    } catch (LoginException le2) {
		throw le;
	    }
	    throw le;
	}
    }

The Exception message is <b>"Access Denied"</b>. Does it ring a bell?