blindsidenetworks / omniauth-bn-office365

GNU General Public License v3.0
0 stars 5 forks source link

Microsoft Graph Attribute raw_info['mail'] causes error #6

Open iiiich opened 4 years ago

iiiich commented 4 years ago

Hi Blinsidenetworks-Team,

we got an on-prem Active Directory which is synced to our Azure-AD and try to connect our Azure-AD to bigbluebutton. It seems to be a problem when the https://graph.microsoft.com/v1.0/me/ endpoint delivers a mail-attribute. If we use a normal Azure-AD-User the authentication works well, but the synced users from our Active Directory with the mail-attribute can't login and get the error "Invalid_credentials".

I looked into the code and maybe the following lines in https://github.com/blindsidenetworks/omniauth-bn-office365/blob/master/lib/omniauth/strategies/office365.rb causes the error:

…
36:    email: raw_info['mail'] || raw_info['userPrincipalName']
…
91:     email = token["mail"] || token["userPrincipalName"]
…

Edit: After some changes we could deliver the on-prem users without the email-field, but they still can't login.

Thank you very much, robert