Commit 2e6b537018062b8407411e7bd51327f797f2fe1f

Authored by Jacob Vosmaer
1 parent 4af38885

Use omniauth nickname as the username for LDAP

Before there was a bug in omniauth-ldap which prevented samaccountname
showing up as a possible username for new LDAP users. Thanks to upstream
fixes, we no longer need to work around this bug.
Showing 2 changed files with 2 additions and 5 deletions   Show diff stats
CHANGELOG
... ... @@ -2,6 +2,7 @@ v 6.8.0
2 2 - Ability to at mention users that are participating in issue and merge req. discussion
3 3 - Enabled GZip Compression for assets in example Nginx, make sure that Nginx is compiled with --with-http_gzip_static_module flag (this is default in Ubuntu)
4 4 - Make user search case-insensitive (Christopher Arnold)
  5 + - Remove omniauth-ldap nickname bug workaround
5 6  
6 7 v 6.7.2
7 8 - Fix upgrader script
... ...
lib/gitlab/ldap/user.rb
... ... @@ -86,11 +86,7 @@ module Gitlab
86 86 end
87 87  
88 88 def username
89   - (auth.info.nickname || samaccountname).to_s.force_encoding("utf-8")
90   - end
91   -
92   - def samaccountname
93   - (auth.extra[:raw_info][:samaccountname] || []).first
  89 + auth.info.nickname.to_s.force_encoding("utf-8")
94 90 end
95 91  
96 92 def provider
... ...