Unable to login using Windows AAD

Created on 21 March 2022, over 2 years ago
Updated 23 April 2024, 2 months ago

Problem/Motivation

Unable to login for the first time using Open ID Windows AAD.
Error: undefined index 'upn'.
openid_connect_windows_aad/src/Plugin/OpenIDConnectClient/WindowsAad.php(258): Drupal\openid_connect_windows_aad\Plugin\OpenIDConnectClient\WindowsAad->buildUserinfo('gyducvebfew ...', 'https://graph.m...', 'upn', 'name')

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇮🇳India Nisith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India vishal.kadam Mumbai

    The above patch works but it still throws warning "Email address not found in UserInfo. Used username instead, please check this in your profile."

  • Status changed to Needs review 5 months ago
  • 🇮🇳India vishal.kadam Mumbai

    I have created patch to fix the issue and also added fallback for name to email.

  • Status changed to Needs work 2 months ago
  • 🇵🇭Philippines mjgruta

    Thanks for the patch. Works well with v1.4
    We now need to create a patch for the latest version. 2.0.0-beta7

  • 🇮🇳India vishal.kadam Mumbai

    The patch is not required for version 2.0.0-beta7.

    This issue can be resolved by enabling the "Use Graph API otherMails property for email address" option in the OpenID Connect client settings.

  • 🇵🇭Philippines mjgruta

    Thanks, Vishal, I can confirm that enabling "Use Graph API otherMails property for email address" resolves the issue.
    I think we should add a check if $profile_data[$upn] does not exist then we add an extra message to consider enabling the option above.

Production build 0.69.0 2024