Problem is :When i try to login with userName: testUser ,I am getting error message :javax.naming.InvalidNameException.
But when i login with userName:CN=testUser,OU=tomcat,OU=system,DC=company,DC=com,I can login .
I dont understand why I am not able to login with just userName only???
Or what changes i need to do ,to make it work correctly
you have to login with your distinguished name "CN=testUser,OU=tomcat,OU=system,DC=company,DC=com" not with your user name "testUser".
You have a bind user to connect with ldap and your full dn is how the ldap recognizes you, the user name alone mean nothing to ldap.
No changes to do, because is the expected behaviour.
Joined: Apr 23, 2013
thanks Carles for your reply.
but I want to login with userName only,Is that possible??
If yes,then how??
Joined: Apr 19, 2013
Sorry I was misleading you,
My mistake messing the login of the ldap bind user with the login of the tomcat users.
Have you tested
Best reggards and my appologies,
Joined: Apr 23, 2013
I tried this also..
it doesn't help
to login I still need to give the complete pattern:
One of the biggest mistakes that people make when setting up LDAP is trying to mirror the corporate structure as directories in LDAP. It doesn't work well, and when people move around, it's a real pain for maintenance.
So my LDAP directory is organized more like this:
[ list of CNs of employees, with uid and password attributes]
[ list of memberUids corresponding to employee uids]
[ list of memberUids of authorized administrators ]
[ list of memberUids of authorized auditors ]
There are also 2 different ways to test authorization using the LDAP realm. One is to configure it so that the Realm will attempt to connect to the LDAP server using the user-supplied id and password from the login form. Successful connection means successful login.
The other way to test authorization is to use a general query connection userid/password to connect to LDAP and have the LDAP server do searches for the actual userid/password. You must provide the search query.
The search query under the scheme I outlined above would be more like this:
I didn't have a working example handy, so this isn't a full and authoritative solution, but it's the basic plan that I use. The Tomcat LDAP Realm docs are more complete and accurate.
Note that if your "LDAP" is actually Active Directory and you want to use the user's Windows login credentials, they have their own particular format.
An IDE is no substitute for an Intelligent Developer.