Skip to content

Issues getting email with AzureAD OIDC integration #4472

Closed
@dcarrion87

Description

@dcarrion87

We've been having issues with onboarding users via AzureAD OIDC configuration which results in this error:

Message: "No email found in OIDC payload!",

When testing openid profile email by default an id_token comes back with the following.

{
...
  "name": "JV2 User",
  "preferred_username": "[email protected]",
...
}

Have to manually add the email address field to the user in AzureAD portal for this to come back:

{
...
  "email": "[email protected]",
  "name": "JV2 User",
  "preferred_username": "[email protected]",
...
}

I'm just wondering if it should revert back to using preferred_username email address component if email is not there?

Interesting note at: https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-optional-claims#v10-and-v20-optional-claims-set

This value is included by default if the user is a guest in the tenant. For managed users (the users inside the tenant), it must be requested through this optional claim or, on v2.0 only, with the OpenID scope. This value isn't guaranteed to be correct, and is mutable over time - never use it for authorization or to save data for a user. For more information, see Validate the user has permission to access this data. If you require an addressable email address in your app, request this data from the user directly, using this claim as a suggestion or pre-fill in your UX.

This is curious as I would have thought CoderV1 would have had similar issues?

Metadata

Metadata

Assignees

Labels

apiArea: HTTP API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions