Any suggestions for troubleshooting when Microsoft Auth pulls in the wrong email address?

We’re using the following plugin from @cpradio for Microsoft Authentication: Microsoft Authentication

We have a user reporting that when they try to login, the system attempts to use their email address for their account rather than their reply-to/default SMTP address which is:

We’ve checked and the is the email address in the Azure AD account and is the primary/reply-to email address in their Exchange online account.

Mostly what I’m wondering is where I should be looking for log files to help troubleshoot what might be going on with this user?

My guess is that the plugin is prioritizing the mail property of the user resource over userPrincipalName. If this is the case, an update to the plugin should resolve the issue.


It indeed does exactly that! It should be fairly easy to add a setting for this.

info do
          name: raw_info['displayName'] || raw_info['userPrincipalName'],
          email: raw_info['mail'] || raw_info['userPrincipalName']


Thanks for this information. You can use the Graph Explorer to run a query to verify what information this plugin would read from the system.

In our case, we believe that there is some other error going on with the user account that we’d like to remedy rather than attempting to switch to the userPrincipalName. Although the account looks good on-prem, the cloud synced account doesn’t look right. We’re behind on our AADConnect version, so we’re updating that to see if it helps.

Thanks again for the help and the pointers!