[WIP] Fix 2FA enforcement in azd auth login --fresh command#6691
[WIP] Fix 2FA enforcement in azd auth login --fresh command#6691
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a --fresh flag to the azd auth login command to force re-authentication and 2FA/MFA validation. This addresses issue #6667 where users were experiencing problems with expired tokens from the browser by allowing them to bypass cached credentials.
Changes:
- Added a
--freshflag toazd auth loginthat forces re-authentication by setting the MSAL prompt toPromptLogin - Extended the
LoginInteractiveOptionsstruct to support custom MSAL prompt types - Temporarily uses a forked version of the MSAL library for Go while awaiting approval of the upstream PR
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cli/azd/pkg/auth/manager.go | Added Prompt field to LoginInteractiveOptions and logic to apply it during interactive authentication |
| cli/azd/cmd/auth_login.go | Added --fresh flag handling and set PromptLogin when flag is enabled |
| cli/azd/go.mod | Added replace directive to use forked MSAL library |
| cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap | Updated test snapshot with new --fresh flag documentation |
| cli/azd/cmd/testdata/TestFigSpec.ts | Added --fresh flag to Fig autocomplete specification |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ithub.com/Azure/azure-dev into copilot/vscode-ml5m06i3-9hw7
|
/azp run azure-dev - cli |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Cloud agent has begun work on take the current cha... and will update this pull request as work progresses.
Original prompt
Created from VS Code.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.