LDAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesLDAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 26th, 2007, 12:26 PM
ldap_user2 ldap_user2 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 2 ldap_user2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 32 sec
Reputation Power: 0
Question Java authentication with ldap

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://server.raleigh.basf-corp.com:389");
env.put(Context.SECURITY_PRINCIPAL, "uid=username");
env.put(Context.SECURITY_CREDENTIALS, "password");
DirContext ctx = new InitialDirContext(env);

When I try to create a new InitialDirContext, I receive the following:
[LDAP: error code 32 - No Such Object]

The error in the ldap log has the following:
BIND dn="uid=username" method=128 version=3
RESULT err=32 tag=97...
closing - B1
closed.

If I remove the uid= for the SECURITY_PRINCIPAL then I receive a error:
[LDAP: error code 34 - Invalid DN]

I have seen these errors on numerous forums, but no solution is provided. Any suggestions?

-ld

Reply With Quote
  #2  
Old June 26th, 2007, 03:39 PM
ldap_user2 ldap_user2 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 2 ldap_user2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 32 sec
Reputation Power: 0
re: Java authentication with ldap

Quote:
Originally Posted by ldap_user2
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://server.raleigh.basf-corp.com:389");
env.put(Context.SECURITY_PRINCIPAL, "uid=username");
env.put(Context.SECURITY_CREDENTIALS, "password");
DirContext ctx = new InitialDirContext(env);

When I try to create a new InitialDirContext, I receive the following:
[LDAP: error code 32 - No Such Object]

The error in the ldap log has the following:
BIND dn="uid=username" method=128 version=3
RESULT err=32 tag=97...
closing - B1
closed.

If I remove the uid= for the SECURITY_PRINCIPAL then I receive a error:
[LDAP: error code 34 - Invalid DN]

I have seen these errors on numerous forums, but no solution is provided. Any suggestions?

-ld


I found a solution. It happens that the ldap server that I was using had an invalid entry. I pointed to another ldap server and the problem is resolved. -ld

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesLDAP Programming > Java authentication with ldap


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT