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

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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 April 20th, 2012, 01:41 AM
p005 p005 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 1 p005 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 m 38 sec
Reputation Power: 0
LDAP authentication

Hello everyone,
I have a java class for simple ldap authentication (true or false).
Premise that, obviously, username and password are correct, the server address is correct, I have tried solutions practically anywhere.
The code is:

Code:
public class jcInterrogaLDAP {

    public boolean InterrogaLDAP(String usr, String psw) {
        boolean blLdapVerify = false;
        Properties env = new Properties();
        env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
        env.put(Context.PROVIDER_URL, "ldap://atmdc03:389");
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL, "cn=" + usr + ",conn");
        env.put(Context.SECURITY_CREDENTIALS, psw);
        try {
            DirContext authContext = new InitialDirContext(env);
            // Authentication OK
            blLdapVerify = true;
            authContext.close();
        } catch (AuthenticationException authEx) {
            authEx.getMessage();
            // Authentication failed
            blLdapVerify = false;
        } catch (NamingException namEx) {
            namEx.getMessage();
            // Something went wrong 
            blLdapVerify = false;
        }
        return blLdapVerify;
    }
}


The error message is:

Code:
javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 525, v893]


Someone sees a mistake?
Thanks
Massimo

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesLDAP Programming > LDAP authentication

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap