Open DOMZE opened 3 weeks ago
@bgavrilMS / @jennyf19 / @jmprieur please review.
Thank you!
@microsoft-github-policy-service agree
LGTM, I only have minor comments and resolving @msbw2 's comments
@bgavrilMS @jmprieur @jennyf19 @pmaytak to be able to go forward, we just need your input on claims casing match (type+value/value only) and the changes are done.
Thank you!
@bgavrilMS @jmprieur @jennyf19 @pmaytak to be able to go forward, we just need your input on claims casing match (type+value/value only) and the changes are done.
Thank you!
I am fine with case insensitive.
@bgavrilMS @jmprieur @jennyf19 @pmaytak to be able to go forward, we just need your input on claims casing match (type+value/value only) and the changes are done.
Thank you!
ClaimsType should never be treated as case insensitive
I think claim names should be case sensitive at least as per JWT spec. IdentityModel also treats them as case sensstive.
Read the issue, thought about this more. When we search for a claim to validate or use, then we should be case sensitive. This way we get the exact claim we're looking for. However, if our intent is to throw an exception if the user specified any variation of utid or uid, then we should use case insensitive approach to broaden the search. This way we ensure that the token only ever has utid and uid variations of claim names.
Add checks to protect the users to not use internal claims used by the library
Summary of the changes (Less than 80 chars)
Description
Introduce InternalClaimDetectedException in Microsoft.Identity.Web and Microsoft.Identity.Web.OWIN namespaces. This exception is thrown when internal ID Token claims (UniqueTenantIdentifier, UniqueObjectIdentifier) are detected in the user's ID Token. Updated AppBuilderExtension.cs and MicrosoftIdentityWebAppAuthenticationBuilder.cs to check for these claims and throw the exception if found. The new exception class includes a property to store the invalid claim
Fixes #2968 (in this specific format)