Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JAAS Blues....

843811Sep 22 2003 — edited Sep 25 2003
I am getting a StringIndexOutOfBoundsException
javax.security.auth.login.LoginException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1444)
at java.lang.String.substring(String.java:1411)
at com.sun.security.auth.module.JndiLoginModule.attemptAuthentication(JndiLoginModule.java:5
36)
...
and that line of code where the exception happens is as follows (indicated with a <- symbol )
Attribute pwd = attributes.get(USER_PWD);
String encryptedPwd = new String((byte[])pwd.get(), "UTF8");
encryptedPassword = encryptedPwd.substring(CRYPT.length()); <---
I used a Java LDAP browser to check it out and for the LDAP url ldap://192.168.0.101/ou=customer,o=abcbank,dc=book,dc=com I got uid, userPassword etc - No Problem...

The LDAP server that I am using is openLDAP and it is running on Redhat Linux 9.0. The client is running on JDK1.4 on Win XP.

What is going on? This has been driving me nuts for over couple of hours now! Gurus throw some light please!

Many thanks, Vish Krishnan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2003
Added on Sep 22 2003
3 comments
208 views