-
Notifications
You must be signed in to change notification settings - Fork 6
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
No Name Claim & Duplicate Email Claims #18
Comments
Thank you reporting this. Can you provide a bit more detail about the type of auth provider being used and the dump of the headers (with sensitive info removed)? From what I understood from your question, the In the meantime you can use the |
Certainly, this is setup using the "Microsoft" identity provider through Azure's Entra ID. The relevant headers are as follows (I have decoded the base64 and redacted where appropriate):
I agree it's intended behavior for the mapper to map the name_typ and role_typ claims, but unless i'm misunderstanding it seems incorrect that it doesn't then pass these claim types as the "nameType" and "roleType" parameters when constructing the ClaimsIdentity object? As currently it results in the identity being populated with a blank name as it is looking for the (now non-existent) name claim. Thank you for for your advice in mapping the claims myself, just wanted to ensure I didn't misunderstand how things should be working. |
{
"auth_typ": "aad",
"claims": [
{
"typ": "role",
"val": "abc"
},
{
"typ": "name",
"val": "Connor Macaskill"
}
],
"name_typ": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
"role_typ": "http://schemas.microsoft.com/ws/2008/06/identity/claims/role"
} The mapper just passes the claims to the ClaimsIdentity object and does not do anything special to mark any of the claims as a name or role right now. Are you suggesting we set the following fields upon constructing the ClaimsIdentity?
This would require some design changes to allow propagating this extra information. We may need to introduce fields in the |
I have a very simple Azure web app configured to use Azure EasyAuth and have implemented this library with success. But I am having issues accessing certain fields in the HttpContext.User.Identity object.
The claims are set as expected, but the Name field is blank despite the "X-MS-CLIENT-PRINCIPAL" header containing a name claim. Manually decoding the header reveals it includes the following two lines:
Which, due to this section of code in StandardPrincipleClaimMapper.cs, results in the name claim being retype as an emailaddress claim.
This results in the identity being created with two emailaddress claims with different values, one containing my name and one containing my actual email address. The values of RoleClaimType and NameClaimType are also never passed as the "nameType" and "roleType" parameters when constructing the ClaimsIdentity object, resulting in the blank Name field.
Is there something I have configured incorrectly or is this intended behaviour? I can't seem to find anything relating to this online.
Thanks!
The text was updated successfully, but these errors were encountered: