Skip to content
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

azd auth login fails due to reauthentication required, run 'azd auth login' to login #2299

Closed
weikanglim opened this issue May 24, 2023 · 0 comments · Fixed by #2300
Closed
Labels
bug Something isn't working

Comments

@weikanglim
Copy link
Contributor

weikanglim commented May 24, 2023

Problem:

  1. Run azd <any command>. See the message: reauthentication required, run 'azd auth login' to login
  2. Run azd auth login

azd auth login fails with message: reauthentication required, run 'azd auth login' to login

Before step 1, it is likely that the user also had previously used azd.

Workaround:

To fix this issue, remove the azd token cache:

bash: rm -rf ~/.azd/auth
pwsh: Remove-Item -Force -Recurse $HOME/.azd/auth

Then, rerun azd auth login. The login should now succeed.

Fix

Upgrade to version >= 1.0.1 which has the fix for this issue.

@weikanglim weikanglim added the bug Something isn't working label May 24, 2023
weikanglim added a commit that referenced this issue May 25, 2023
This change updates our MSAL cache adapter to no longer use the hinted partition key as a cache key. Instead, the current user has a fixed cache key equal to the empty string `""`. This creates the behavior of `~/.azd/auth/msal/cache.[bin|json]` being the single file that contains MSAL multi-account data, as defined by this [contract](https://github.com/AzureAD/microsoft-authentication-library-for-go/blob/27c98c8f9db6bc564c5be43677f3e6276b7c4fef/apps/internal/base/internal/storage/items.go#L18).

Also, fix logout not resetting `cache.json` due to using `config.json` (userConfigManger.Load) and not `auth.json` (readAuthConfig).

Fixes #2299
@weikanglim weikanglim reopened this May 25, 2023
weikanglim added a commit that referenced this issue May 25, 2023
This change updates our MSAL cache adapter to no longer use the hinted partition key as a cache key. Instead, the current user has a fixed cache key equal to the empty string `""`. This creates the behavior of `~/.azd/auth/msal/cache.[bin|json]` being the single file that contains MSAL multi-account data, as defined by this [contract](https://github.com/AzureAD/microsoft-authentication-library-for-go/blob/27c98c8f9db6bc564c5be43677f3e6276b7c4fef/apps/internal/base/internal/storage/items.go#L18).

Also, fix logout not resetting `cache.json` due to using `config.json` (userConfigManger.Load) and not `auth.json` (readAuthConfig).

Fixes #2299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant