Skip to content

Conversation

@DOMZE
Copy link
Contributor

@DOMZE DOMZE commented Nov 6, 2024

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)

DOMZE added 2 commits November 5, 2024 15:08
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
@DOMZE DOMZE requested a review from a team as a code owner November 6, 2024 17:07
@DOMZE
Copy link
Contributor Author

DOMZE commented Nov 6, 2024

@bgavrilMS / @jennyf19 / @jmprieur please review.

Thank you!

@DOMZE
Copy link
Contributor Author

DOMZE commented Nov 6, 2024

@microsoft-github-policy-service agree

Copy link

@dstamand-msft dstamand-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes were made in regards to feedback

@jennyf19 jennyf19 added this to the 3.3.2 milestone Nov 8, 2024
@bgavrilMS
Copy link
Member

LGTM, I only have minor comments and resolving @msbw2 's comments

This was referenced Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] GetAuthenticationResultForUserAsync throws an exception when user is authenticated

6 participants