az login fails requiring MFA despite MFA prompt being displayed and successfully followed during login.

Stephen McCaul 0 Reputation points
2025-05-18T02:10:01.34+00:00

I run az login which opens the login window and i go through a normal multi factor login flow and then it errors saying Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access XXXX`.

The account has MFA enabled and the login flow was MFA (via authenticator app).

I've also tried a device code login which errors in the same manner after also going through an MFA login flow.

This is just a simple pay as you go azure account with one user that is also admin. There is only one tenant associated with the account and it has "security defaults" enabled so it trying to enforce MFA makes sense. But as i have logged in with MFA it should not reject the login.

Disabling "security defaults" solves this problem. Which is not ideal but MFA login appears broken.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
24,961 questions
{count} votes

1 answer

Sort by: Most helpful
  1. David Broggy 6,286 Reputation points MVP Volunteer Moderator
    2025-05-18T05:25:01.9266667+00:00

    Hi Stephen,

    I believe that's a very common issue.

    I see it all the time because I'm flipping between tenants with different user ids.

    You will probably find it goes away if you switch to incognito/private browsing, because then your cache history is not being used.

    The way I deal with it isn't perfect, but I set my browser security settings to clear cache every time I exit my browser.

    I've heard others deal with it by using Firefox where they provide a type of containers/virtualization between browser tabs.

    References:

    https://support.google.com/chrome/community-guide/245444314/how-to-automatically-clear-browsing-data-when-closing-google-chrome-window-a-step-by-step-guide?hl=en

    https://support.mozilla.org/en-US/kb/how-use-firefox-containers

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.