Question : how do I connect Ldap server through web based aplication for authentication.

Hi  All,

we are having web based application build in JSP. Before we are going live , we are testing this application in our test environment. While logging into this application I m getting this error message. I have created the user in LDAP server & the same users credentials i am using while logging into this application. But everytime I am getting this error message.

Note: Ldap server URL I do have mentioned in application

ERROR 13 Aug 2009 16:49:35,252 org.eclipsys.sch.sunrise.component.UserAD - Problem searching directory: javax.naming.InvalidNameException: [LDAP: error code 34 - invalid DN]

Can you guys plz take a look on this.

Answer : how do I connect Ldap server through web based aplication for authentication.

Exactly where do you passon the username to the LDAP server?
I am not proficient in JSP, so ...

my best guess would be:
       BASE_DN = "DC=myorg, DC=local";                    // depends on you LDAP ...
       env.put(Context.SECURITY_PRINCIPAL, userName+", "+BASE_DN);

You might need an "DN:" in fron I am not sure of that.

Here is an elaborate example: (with checks for roles).
http://www.codase.com/search/display?file=L2dlbnRvbzIvdmFyL3RtcC9yZXBvcy9zb3VyY2Vmb3JnZS9qYm9zcy9qYm9zcy1qZGs1LXNlYW0tNDAzUkMyLXNyY190YXJfZ3ovamJvc3MtamRrNS1zZWFtLTQwM1JDMi1zcmMvc2VjdXJpdHkvc3JjL21haW4vb3JnL2pib3NzL3NlY3VyaXR5L2F1dGgvc3BpL0xkYXBFeHRMb2dpbk1vZHVsZS5qYXZh&lang=java&off=13920+13953+
Random Solutions  
 
programming4us programming4us