-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Profile] az login: Support --claims-challenge in device code flow
#31856
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
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @jiasli, |
️✔️AzureCLI-BreakingChangeTest
|
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.
Pull Request Overview
This PR adds support for the --claims-challenge parameter in the device code flow for az login. Previously, claims challenge was only supported in the interactive auth code flow due to MSAL library limitations that have since been resolved.
- Updates the
login_with_device_codemethod to accept and pass through theclaims_challengeparameter - Modifies the profile login logic to pass the claims challenge parameter to device code flow
- Enables consistent claims challenge support across both authentication flows
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/azure-cli-core/azure/cli/core/auth/identity.py | Adds claims_challenge parameter to login_with_device_code method and passes it to MSAL calls |
| src/azure-cli-core/azure/cli/core/_profile.py | Updates device code flow invocation to include claims_challenge parameter |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
df32c29 to
3c33eda
Compare
3c33eda to
a306b0f
Compare
Related command
az login --use-device-codeDescription
#31778 didn't add
--claims-challengefor device code flow because of MSAL limitation AzureAD/microsoft-authentication-library-for-python#834.After MSAL fixes it in AzureAD/microsoft-authentication-library-for-python#839, this PR adds
--claims-challengefor device code flow.Testing Guide
Then verify the access token's
amr(Authentication Methods Reference) claim containsmfa:History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.