Skip to content
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

Implemented functionality to skip the cache for MI when claims are provided #7207

Merged
merged 29 commits into from
Sep 30, 2024

Conversation

Robbie-Microsoft
Copy link
Collaborator

@Robbie-Microsoft Robbie-Microsoft commented Jul 17, 2024

Re-used functionality from ClientCredential flow.

This PR originally contained code to deprecate client assertion strings. That will now be a separate PR.

@github-actions github-actions bot added the msal-node Related to msal-node package label Jul 17, 2024
@github-actions github-actions bot added the msal-common Related to msal-common package label Jul 17, 2024
@bgavrilMS
Copy link
Member

@Robbie-Microsoft - pls continue to the work we discussed, but do not commit. This work hasn't been OK-ed yet by the MSI team. It will anyway be required for MSIv2.

@gladjohn - please close the work items until we get confirmation.

@github-actions github-actions bot removed the documentation Related to documentation. label Aug 29, 2024
@github-actions github-actions bot added the documentation Related to documentation. label Sep 11, 2024
@github-actions github-actions bot removed the msal-common Related to msal-common package label Sep 26, 2024
@@ -142,7 +142,10 @@ export class ManagedIdentityApplication {
correlationId: this.cryptoProvider.createNewGuid(),
};

if (managedIdentityRequest.forceRefresh) {
if (
managedIdentityRequestParams.claims ||

Choose a reason for hiding this comment

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

does msal js already have a way for app developers to provide this ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, but only per request basis. Hence, me adding the claims to the MI request params.

@@ -5,10 +5,12 @@

/**
* ManagedIdentityRequest
* - claims - a stringified claims request which will be used to determine whether or not the cache should be skipped
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* - claims - a stringified claims request which will be used to determine whether or not the cache should be skipped
* - claims - in case a resource refuses to authenticate with a token (e.g. because the token has been revoked by the tenant admin), it may send a 401 response and a WWW-Authenticate header with a claims parameter. When this is configured, MSAL always requests a new token from the identity provider, and will add the claims to the request where this is supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to documentation. msal-node Related to msal-node package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Engineering task] Implement Claims API to Bypass Cache When Claims are Present in MSAL with Managed Identity
4 participants