LDAP Fail on Authentication

173 views
Skip to first unread message

sup...@kernel.inf.br

unread,
May 26, 2016, 10:26:22 AM5/26/16
to NxFilter
I'm trying to use authentication over ldap.
Was using base dn: dc=example,dc=com,dc=br
NxFilter imports users and groups. But when I try to authentica it's using "uname = uid=userlogging,dc=example,dc=com,dc=br" but my user is on  'ou=users,dc=example,dc=com,dc=br'
So I changed the configuration to use base dn: ou=Users,dc=example, dc=com, dc=br
Obviously when i synchronized the groups was deletes ( groups are on ou=Groups,dc=example,dc=com,dc=br )
But i try to authenticate again, the log return:
ERROR [05-26 11:22:21] - uname = uid=userlogging,ou=users,dc=example,dc=com,dc=br, error = javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
On LDAP the password is using ssha

1 - I think that LDAP module has to search on subtree or permit to configure dn base for group and dn base for users. With subtree is better.
2 - Invalid Credentials? Why? 

What am I doing wrong?

Jinhee

unread,
May 26, 2016, 10:49:25 AM5/26/16
to NxFilter
Did you use OpenLDAP? If so where did you install it? On Linux?

In your case, you'd need to go with 'dc=example,dc=com,dc=br'.

Did you try your LDAP admin account and password as well? We do the same kind of authentication process as when you import your users.

Jinhee

unread,
May 26, 2016, 10:49:58 AM5/26/16
to NxFilter
We do subtree search.
Message has been deleted
Message has been deleted

Jinhee

unread,
May 26, 2016, 11:21:56 AM5/26/16
to NxFilter
We transform your user name for OpenLDAP login. If your username is 'userlogging' then we try this,

  uid=userlogging,ou=users,dc=example,dc=com,dc=br

So I think it's OK. But if it fails we do one more with,

  cn=userlogging,ou=users,dc=example,dc=com,dc=br

Anyway we need to know what's your LDAP server first.

sup...@kernel.inf.br

unread,
May 27, 2016, 2:05:20 AM5/27/16
to NxFilter
OpenLDAP - package slapd - 2.4.31 - Ubuntu Server 14.04
But, the log shows without include ( ou=users ) except if i put on base DN but when i do this I lost the synchronize of groups and the authentication doesn't works like before.

sup...@kernel.inf.br

unread,
May 27, 2016, 2:11:00 AM5/27/16
to NxFilter
Yes, i tested with LDAP admin account and password, this works. But the others not.

sup...@kernel.inf.br

unread,
May 27, 2016, 2:16:08 AM5/27/16
to NxFilter
I look the type hash used on LDAP admin is crypt and i change my user do uses this. But it didn't work. I noted that when I change my password and i forced a sync the register shows no one change.

Jinhee

unread,
May 27, 2016, 4:57:57 AM5/27/16
to NxFilter
You should have users and groups in the same OU. Do you have any reason not to have them in the same OU?

Jinhee

unread,
May 27, 2016, 5:31:29 AM5/27/16
to NxFilter
We might work on it to make it working even if you import your users and groups separately. But at the moment you need to have them in the same OU. And that's a subtree scope query.

sup...@kernel.inf.br

unread,
May 27, 2016, 9:13:45 AM5/27/16
to NxFilter
Just using the traditional mode of a single organization.
To do this change I will modify all systems onliest to NxFilter works.
The import works very well to bring groups and users fail onliest on authentication.

sup...@kernel.inf.br

unread,
May 27, 2016, 9:34:33 AM5/27/16
to NxFilter
Do you want that I change to debug mode?
Even if the tree is on a different pattern I'm pointing the root (on setup the base) of the tree LDAP, so that it would see all OUs

Jinhee

unread,
May 27, 2016, 9:49:40 AM5/27/16
to NxFilter
The problem is that we don't know the 'OU' from your username. If you use this kind of basedn,

  ou=users,dc=example,dc=com,dc=br

We know the OU and we can use it when you try to login. But if you use the basedn without OU.

  dc=example,dc=com,dc=br

We don't know the OU and we use this kind of DN when you try to login,

  uid=userlogging,dc=example,dc=com,dc=br

But when you specify the OU that is 'users' we don't see the groups. We sould be able to see your users and groups in the same OU.

Jinhee

unread,
May 27, 2016, 9:55:24 AM5/27/16
to NxFilter
The other possible way is that we allow another type of username. When you login you use,

  cn=userlogging,ou=users,dc=example,dc=com,dc=br

And we extract 'userlogging' from that DN and we create a session for that. We need to modify several things but it's possible.

Jinhee

unread,
May 27, 2016, 10:13:20 AM5/27/16
to NxFilter
I think that's the most promising way. Though your users don't like it to use a full DN for login that's just way it is when you separate your users and groups from each other.

sup...@kernel.inf.br

unread,
May 27, 2016, 4:20:53 PM5/27/16
to NxFilter
yeah, i think that is the way

sup...@kernel.inf.br

unread,
May 27, 2016, 4:49:25 PM5/27/16
to NxFilter
cn and uid correct?
cn=userlogging 
and
uid=userlogging


Message has been deleted

Jinhee

unread,
May 28, 2016, 1:51:24 AM5/28/16
to NxFilter
I tested it. 'cn' didn't work. You have to use 'uid'. So it would be,

  uid=userlogging,ou=users,dc=example,dc=com,dc=br

This is the patched nxd.jar replace your /nxfilter/nxd.jar with it and restart NxFilter.

sup...@kernel.inf.br

unread,
May 28, 2016, 8:46:07 AM5/28/16
to NxFilter
I updated.
I'm using NxFilter 3.2.0
My configuration:
Base DN: dc=example,dc=com,dc=br
Base synchronized:
ERROR [05-28 09:33:35] - uname = uid=userlogging,dc=example,dc=com,dc=br, error = javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]

Doesn't works.

I changed my configuration to force use Ou=Users:
Base DN: Ou=Users, dc=example,dc=com,dc=br
Base not yet synchronized to mantain groups.
INFO [05-28 09:38:53] - TalkUtil.deal_login, New login session for 192.168.100.185, userlogging
Works, but if i synchronize i lost groups that are on: Ou=Groups,cn=example,dc=com,dc=br




Jinhee

unread,
May 28, 2016, 9:19:01 AM5/28/16
to NxFilter
What I am saying is to use the following as the username on your login-page.

   'uid=userlogging,ou=users,dc=example,dc=com,dc=br'

Not using only 'userlogging'. You are supposed to login to your LDAP server with the DN anyway.

sup...@kernel.inf.br

unread,
May 28, 2016, 9:19:50 AM5/28/16
to NxFilter
I made a test.
I create an Ou called Ou=Empresa,dc=example,dc=com,dc=br
And create a subtree Ou=Users and ou=Groups
Create users and groups under the respective Ou.
So i have Ou=Empresa and Ou=Users,Ou=Empresa and Ou=Groups,ou=Empresa
I change the configuration to base dn=Ou=Empresa,dc=example,dc=com,dc=br
Synchronized ok.
But event so I had failed on authentication. I don't know why the nxFilter don't check my subtree on authentication.

sup...@kernel.inf.br

unread,
May 28, 2016, 9:20:24 AM5/28/16
to NxFilter
NxFilter filter by any object on ldap?

sup...@kernel.inf.br

unread,
May 28, 2016, 9:35:26 AM5/28/16
to NxFilter
But for the ordinary user this is impractical

Jinhee

unread,
May 28, 2016, 9:37:03 AM5/28/16
to NxFilter
Go back to the old one. Use 'dc=example,dc=com,dc=br' as your basedn. And use this as your username on your login-page.

  uid=userlogging,ou=users,dc=example,dc=com,dc=br

Did you already try that? Did you have the log from NxFilter when you did that?

sup...@kernel.inf.br

unread,
May 28, 2016, 9:51:03 AM5/28/16
to NxFilter
I try, it really works login with uid=userlogging,ou=users,dc=example,dc=com,dc=br
But I can't say to the user uses this.
INFO [05-28 10:37:22] - TalkUtil.deal_login, New login session for 192.168.yy.1xx, userlogging


But on logging i see this error: ERROR [05-28 10:31:19] - LdapAgent.get_obj_arr_ol: javax.naming.SizeLimitExceededException: [LDAP: error code 4 - Sizelimit Exceeded]; remaining name 'dc=agespisa,dc=com,dc=br'

Jinhee

unread,
May 28, 2016, 10:20:31 AM5/28/16
to NxFilter
Then you go back to the old problem. Put the users and groups in the same OU. It's organization unit, why can't you have the users and groups in the same OU?

If you have to use the current LDAP structure you have to use that lengthy login username. We do this on background,

  username from login-page + basd DN from DB

So what you get? You do the math.

If you don't want to tell your user to add 'ou=users,dc=example,dc=com,dc=br' part then you add it on JSP page level. You know JSP code. Or Javascript on your
login-page.

That size limit error is about paging. But we already do paging. How many users do you have on your LDAP server?

sup...@kernel.inf.br

unread,
May 28, 2016, 12:52:37 PM5/28/16
to NxFilter
>>Then you go back to the old problem. Put the users and groups in the same OU. It's organization unit, why can't you have the users and groups in the same OU?
First, because i have all other systems configurated by this way if i change the tree this will generate problems in another systems. I have GitLAB, SVN, Apache Authentication, MX. All other working this way.
Second, this doesn't works. I create a model like you said, if you see older emails.

> If you have to use the current LDAP structure you have to use that lengthy login username. We do this on background,
 >username from login-page + basd DN from DB

The users won't accept and i think that they are right.

>So what you get? You do the math.

>If you don't want to tell your user to add 'ou=users,dc=example,dc=com,dc=br' part then you add it on JSP page level. You know JSP code. Or Javascript on your login-page.


> That size limit error is about paging. But we already do paging. How many users do you have on your LDAP server?
1040

Jinhee

unread,
May 28, 2016, 9:09:03 PM5/28/16
to NxFilter
Your older email shows that you didn't understand what I have said at all. You do it the same thing on another level. What do you get with your LDAP Admin when you use your 'OU' as your basedn. You only get your users not groups. But you use 'OU' when you login. We do importation and login. Not just login, not just importation. We do both of them. And you use two different DN to login and to import. That's the problem. I can solve that problem by having 'Login DN' but this is not a general situation. Maybe we can do the login process several times with all the OUs. But I am not sure if it's worth enough.

Your users won't accep? Did I not already tell you that?

We do paging. I don't know why it's not working on your system. I might need to test it on my OpenLDAP server first.

Jinhee

unread,
May 29, 2016, 12:58:51 AM5/29/16
to NxFilter
We can solve the problem by keeping the full DN in DB. This one takes some testing procedure though. Will be available in several days.

Jinhee

unread,
Jun 2, 2016, 8:44:35 PM6/2/16
to NxFilter
Try this one,


It keeps the original DN for LDAP login. This means you can import user and groups without OU and login with just a username.

sup...@kernel.inf.br

unread,
Jun 3, 2016, 11:50:28 AM6/3/16
to NxFilter
The authentication works, but the import gives Error 500

Jinhee

unread,
Jun 3, 2016, 5:22:32 PM6/3/16
to nxfil...@googlegroups.com
Are you saying that you have 500 error on your webpage? Can you show me a capture image for NxFilter output while you have the 500 error?
Reply all
Reply to author
Forward
0 new messages