[WIP] Fix 2FA enforcement in azd auth login --fresh command#6691
Open
[WIP] Fix 2FA enforcement in azd auth login --fresh command#6691
Conversation
Contributor
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.
Copilot stopped work on behalf of
vhvb1989 due to an error
February 2, 2026 20:44
This was
linked to
issues
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.