-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add mock test cases for CAE auth in mgmt client #32351
base: main
Are you sure you want to change the base?
Conversation
API change check API changes are not detected in this pull request. |
describe("Mock test for CAE with ResourceManagementClient", () => { | ||
// this is not a real token, does not contain any sensitive info, just for test. | ||
const caeChallenge = `Bearer realm="", error_description="Continuous access evaluation resulted in challenge", error="insufficient_claims", claims="eyJhY2Nlc3NfdG9rZW4iOnsibmJmIjp7ImVzc2VudGlhbCI6dHJ1ZSwgInZhbHVlIjoiMTcyNjI1ODEyMiJ9fX0=" `; | ||
const invalidCAEChallenge = `Bearer realm="", error_description="", error="insufficient_claims", claims=""`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious what decides if the caeChallenge is valid or not? maybe we should add some description for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment for that: regarding CAE challenge string you could refer the link https://learn.microsoft.com/entra/identity-platform/claims-challenge.
Our code implementation is aligned with that doc: https://github.com/azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/src/policies/bearerTokenAuthenticationPolicy.ts#L375.
fixes #31754