8000 Added token revocation functionality to Managed Identity's App Service and Service Fabric sources by Robbie-Microsoft · Pull Request #7679 · AzureAD/microsoft-authentication-library-for-js · GitHub
[go: up one dir, main page]

Skip to content

Added token revocation functionality to Managed Identity's App Service and Service Fabric sources #7679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contac 8000 t 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

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from

Conversation

Robbie-Microsoft
Copy link
Collaborator
@Robbie-Microsoft Robbie-Microsoft commented Apr 2, 2025

@github-actions github-actions bot added documentation Related to documentation. msal-node Related to msal-node package labels Apr 2, 2025
@Robbie-Microsoft Robbie-Microsoft changed the title Added token revocation functionality to Managed Identity's App Service and Service Fabric Sources Added token revocation functionality to Managed Identity's App Service and Service Fabric sources Apr 2, 2025
@Robbie-Microsoft Robbie-Microsoft marked this pull request as ready for review April 3, 2025 22:08
@github-actions github-actions bot added the msal-common Related to msal-common package label Apr 7, 2025
@AzureAD AzureAD deleted a comment from julesblancphin Apr 10, 2025
@@ -176,6 +178,70 @@ describe("Acquires a token successfully via an App Service Managed Identity", ()
});
});

describe("Miscellaneous", () => {
test("ignores a cached token when claims are provided and the Managed Identity does support token revocation, and ensures the token revocation query parameter token_sha256_to_refresh was included in the network request to the Managed Identity", async () => {

Choose a reason for hiding this comment

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

Add test when just the capabilities are set and claims are not passed?

Choose a reason for hiding this comment

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

Are you covering these test cases:

  1. When capabilities are set but no claims are passes, the capabilities should be passed to the endpoint. No refresh of cache on 2nd request when claims are not passed.
  2. When claims are passed but capabilities is not set, the cache is still refreshed and the claims are passed to the endpoint.
  3. When both are present, this you already have covered.

} from "../../utils/Constants.js";
import { CryptoProvider } from "../../crypto/CryptoProvider.js";
import { ManagedIdentityRequestParameters } from "../../config/ManagedIdentityRequestParameters.js";
import { ManagedIdentityId } from "../../config/ManagedIdentityId.js";
import { NodeStorage } from "../../cache/NodeStorage.js";

// MSI Constants. Docs for MSI are available here https://docs.microsoft.com/azure/app-service/overview-managed-identity
const APP_SERVICE_MSI_API_VERSION: string = "2019-08-01";
const APP_SERVICE_MSI_API_VERSION: string = "2025-03-30";

Choose a reason for hiding this comment

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

please do not merge this

Copy link

Choose a reason for hiding this comment

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

Alternatively, remove the app service changes from this PR, and then we can merge it for Service Fabric. We will create a new PR later after app service deploys their token revocation support.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@gladjohn Expected GA for App Service token revocation is 5/30? I will wait to merge until then if you can confirm.

Choose a reason for hiding this comment

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

Expected GA for App Service token revocation is 5/30?

5/30 is availability of the feature in test ring.

Choose a reason for hiding this comment

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

What is the timeline for it to be available in prod? I am expecting that we will not merge until this is available in prod.

Copy link
@gladjohn gladjohn left a comment

Choose a reason for hiding this comment

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

Overall, the PR looks solid. It adds a clear, consistent approach for token revocation. If you remove 'app service' the PR can be merged. Else,. please mark it as 'Do Not Merge'

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label May 19, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: Attention 👋 Awaiting response from the MSAL.js team label May 19, 2025
@@ -8,8 +8,11 @@ import { ManagedIdentityRequestParams } from "./ManagedIdentityRequestParams.js"

/**
* ManagedIdentityRequest
* - forceRefresh - forces managed identity requests to skip the cache and make network calls if true
* - resource - resource requested to access the protected API. It should be of the form "{ResourceIdUri}" or {ResourceIdUri/.default}. For instance https://management.azure.net or, for Microsoft Graph, https://graph.microsoft.com/.default
* - clientCapabilities - an array of capabilities to be added to all network requests as part of the `xms_cc` claims request

Choose a reason for hiding this comment

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

Suggested change
* - clientCapabilities - an array of capabilities to be added to all network requests as part of the `xms_cc` claims request
* - clientCapabilities - an array of capabilities to be added to all network requests as part of the `xms_cc` claim

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

Successfully merging this pull request may close these issues.

5 participants
0