arr2036 / omnigollum

Omniauth authentication for gollum
MIT License
147 stars 61 forks source link

LDAP provider, Error "Insufficient data from authentication provider, email not provided or empty" #66

Closed Tony2 closed 3 years ago

Tony2 commented 3 years ago

Hi,

sorry if this is not the right place to ask this question: I am trying to get omnigollum to work with LDAP. I use https://github.com/arr2036/omnigollum/blob/master/config.rb.example as the starting point. After login I got the error Insufficient data from authentication provider, email not provided or empty so it seems that email is expected from LDAP. My LDAP server return email as mailPrimaryAddress. How do I configure omnigollum to use it for email?

I tried a shot into the dark by changing the line :author_email => Proc.new { |user| user.email } to :author_email => Proc.new { |user| user.mailPrimaryAddress }

but it didn't help. Any idea what I can try next?

Tony2 commented 3 years ago

I got it working by editing /usr/local/bundle/gems/omniauth-ldap-2.0.0/lib/omniauth/strategies/ldap.rb and added mailPrimaryAddress to the array of attributes for email in default (hard-coded) config. I am sure there is a better way, suggestion welcome.