-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ID-token does not propagate 'preferred_username' from Azure ID Token #921
Comments
@ericchiang after some input from a colleague, it looks like the "emailClaim" configuration that is noted here would actually handle the case of dealing with Azure AD. Is there a reason the "emailClaim" mapping was removed? Is there any reason not to add it back? (It looks like there was a big rewrite). |
@jmspring that logic wasn't ported as part of the v2 switch. Maybe @rithujohn191 would be okay with adding a configurable email claim back in? |
Thanks Eric. I'm happy to attempt the work if he is. We have a few customers interested in OIDC solutions integrating with Azure AD and this would be the logical / easiest fix. I don't know if/when Azure AD will expose / support the email claim for OIDC. Per this one needs to directly call the Graph API endpoint to get email info. Which, given the bearer token Sex gets, would be possible to populate the OIDC call to dex from the client app, but would require a custom connector for AD, most likely. |
@jmspring if you would like to take this up I would be more than happy to review the PR. If not I could add it in myself. |
@rithujohn191 - some of us are having an internal hackfest this week, I'll take a stab starting this week. I'll use the old PR as reference. |
So - adding the emailClaim plumbing was pretty straight forward (small change), however, that will only satisfy the Dex requirement for an email address internally. Unfortunately, to integrate with Kubernetes, the email needs to be verified. Near term, to integrate Dex, using a username of the form - is the likely only option. I'll have to look at the Dex approach to verifying the email address. Within Azure AD, a second call to the Graph API is needed to get specific details about the user (at least for now). |
With #1459, you should be able to configure this to use |
Per Azure AD docs Azure will not expose the email even if the claim is required. However, it does return a 'preferred_username' which is not propagated up from dex.
Returned in the id_token from AD:
In AD, in order to get information about the user, a second call is required to the /me endpoint in Microsoft Graph.
The claims dex returns:
Thoughts?
The text was updated successfully, but these errors were encountered: