-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LDAP problem with Harbor 1.1.0 #2034
Comments
I ran into the same problem. I was using sAMAccountName for the ldap uid. I changed it to cn and it was able to find the user name. It seems to be in harbor/src/common/utils/ldap/ldap.go lines 204-218 that LDAP attributes are parsed but only uid, cn, mail, and email. sAMAccountName isn't in the list so it never parses the attribute. At login, the user is successfully authenticated but it is not able to get the sAMAccountName attribute for the username so the attempt is rejected. I would think in adding a case for sAMAccountName would solve the issue. Something like
|
@roldancer Could you provide your LDAP configuration in harbor.cfg? |
@ericallen could you try to set the UID as "samaccountname" and retry? |
Hi, We don't use attribute sAMAccountName, by the way this ldap configuration was working properly with Harbor 0.5.0 ... ##By default the auth mode is db_auth, i.e. the credentials are stored in a local database. #The url for an ldap endpoint. #A user's DN who has the permission to search the LDAP/AD server. #the password of the ldap_searchdn #The base DN from which to look up a user in LDAP/AD #Search filter for LDAP/AD, make sure the syntax of the filter is correct. The attribute used in a search to match a user, it could be uid, cn, email, sAMAccountName or other attributes depending on your LDAP/ADldap_uid = corpAliasLocal #the scope to search for users, 1-LDAP_SCOPE_BASE, 2-LDAP_SCOPE_ONELEVEL, 3-LDAP_SCOPE_SUBTREE |
Could you set the ldap_uid as corpaliaslocal and try again? Do these on configuration tab of web UI . |
I did that but it doesn't work, for some reason my user can login but with admin role ... |
What do you mean by "for some reason my user can login but with admin role"? Does it mean only admin user can login? |
@ywk253100 we are facing the same issue as @roldancer described. harbor.cfg:
I've attempted to use different
|
@gavinbunney I believe the workaround is to set the value of ldap_uid in lowercase, could you update it via ui and retry? |
Tried that :) same error:
Also tried various combinations of case to check for case-sensitiveness. |
Note: Anyone else facing this issue, don't do this 🥇 - just attempting to find the cause As an attempt to fix this, I tried to delete an affected user from the mysql database, and it then allows the user in (sort of). The user record created has no username - after you logout and back in, the user then assumes the role of an admin. Prior to delete:
After delete and relogging in:
This illustrates the fact of the ldap adapter not retrieving the username correctly. Note: this was an upgrade from 0.5 to 1.1. |
It looks like they are limited down the ldap attributes that are returned back to uid, cn,mail,email. So if you are using anything else it will not be able to look it up. harbor/src/common/utils/ldap/ldap.go
Using anything other than one of those attributes will end up failing because it never has ldap return those attributes. |
@gavinbunney I have the same problem .... |
We will have a fix for this issue. |
Same problem here and also a strange behaviour. If I remove an user from being admin he still get the admin permission (and when logging in the user see itself as admin in the right corner). |
@fduranti are you using AD? |
tried only with ad. I've logged on with an ad user and it was not administrator. |
Proposed release note entry:
@reasonerjt does this cover it? Thanks! |
"If you use AD as LDAP server, you may have issue logging in" @stuclem |
@reasonerjt apologies for the delay, I was on vacation. It looks like you updated the release note already. |
The issue has been fixed and please use 1.1.1-rc1 |
I confirm that 1.1.1-rc1 solved the problem for us ! |
Hi All, We had Harbor 0.5.0 working properly with Active Directory (LDAP) but after migrating to Harbor 1.1.0 LDAP integration is not working I get the following error.
Apr 17 17:34:27 172.19.0.1 ui[20184]: 2017-04-17T15:34:27Z [DEBUG] [authenticator.go:59]: Current AUTH_MODE is ldap_auth
Apr 17 17:34:27 172.19.0.1 ui[20184]: 2017-04-17T15:34:27Z [DEBUG] [ldap.go:145]: one or more ldapFilter: FILTER_DELETED_FOR_SECURITY_REASONS
Apr 17 17:34:27 172.19.0.1 ui[20184]: 2017-04-17T15:34:27Z [DEBUG] [ldap.go:280]: username:,email:[email protected]
Apr 17 17:34:27 172.19.0.1 ui[20184]: 2017-04-17T15:34:27Z [ERROR] [ldap.go:97]: Can't import user , error: duplicate_mailbox
Apr 17 17:34:27 172.19.0.1 ui[20184]: 2017-04-17T15:34:27Z [ERROR] [base.go:64]: Error occurred in UserLogin: can't import user , error: duplicate_mailbox
Any idea ?
The text was updated successfully, but these errors were encountered: