Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

Found multiple accounts with same username #20168

Open dylankdreyer78 opened 3 years ago

dylankdreyer78 commented 3 years ago

When trying to log in using the CLI I get this error:

image

I have obviously made a mess of things here but I don't know how to sort this out now :/

Any ideas?

jiasli commented 3 years ago

Could you please share some extra information:

  1. How is Azure CLI installed? Did you install it following https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli or using pip?
  2. Could you turn off token encryption first and log in again?
    az config set core.token_encryption=false
    az login

    Then share the content of Account property in C:\Users\<username>\.azure\msal_token_cache.json. ⚠ token_encryption is experimental and subject to change at any time!

dylankdreyer78 commented 3 years ago

Thanks so much for pointing me in the right direction. cleared the cache and works 100% now!

jiasli commented 3 years ago

@dylankdreyer78, I am glad to know it works for you. Do you mind letting us know what action you have performed? Thanks a lot.

dylankdreyer78 commented 3 years ago

No problem. I deleted the json files in the .azure directory :)

jiasli commented 3 years ago

Hmm... This still didn't reveal why it happened in the first place. Anyway, we will keep monitoring for other occurrences. Thanks for letting us know.

hivyas commented 3 years ago

Hi there, I am seeing the same issue. Deleting the cache file and relogging in did not work. I also only see a msal_token_cache.bin file, not a .json file.

EDIT: After running az config set core.token_encryption=false az login --use-device-code (az login never works for me) I now see a .json file.

"Account": {
        "508c96e0-d4ff-4c30-b886-34c377353339.72f988bf-86f1-41af-91ab-2d7cd011db47-login.microsoftonline.com-organizations": {
            "home_account_id": "508c96e0-d4ff-4c30-b886-34c377353339.72f988bf-86f1-41af-91ab-2d7cd011db47",
            "environment": "login.microsoftonline.com",
            "realm": "organizations",
            "local_account_id": "508c96e0-d4ff-4c30-b886-34c377353339",
            "username": "hivyas@microsoft.com",
            "authority_type": "MSSTS"
        },
        "508c96e0-d4ff-4c30-b886-34c377353339.72f988bf-86f1-41af-91ab-2d7cd011db47-login.microsoftonline.com-72f988bf-86f1-41af-91ab-2d7cd011db47": {
            "home_account_id": "508c96e0-d4ff-4c30-b886-34c377353339.72f988bf-86f1-41af-91ab-2d7cd011db47",
            "environment": "login.microsoftonline.com",
            "realm": "72f988bf-86f1-41af-91ab-2d7cd011db47",
            "local_account_id": "508c96e0-d4ff-4c30-b886-34c377353339",
            "username": "hivyas@microsoft.com",
            "authority_type": "MSSTS"
        }
    },
jiasli commented 3 years ago

@hivyas, as shown in the output, these 2 accounts share the same "home_account_id": "508c96e0-d4ff-4c30-b886-34c377353339.72f988bf-86f1-41af-91ab-2d7cd011db47". In such case, MSAL will group them (https://github.com/AzureAD/microsoft-authentication-library-for-python/pull/349).

Are you using Azure CLI from source code? If so, please verify if your MSAL is update to date and configure all Azure CLI dependencies again.

pip list
azdev setup --cli
Tomnowell commented 3 years ago

Hi jiasli, Thanks for the email. I'm in a similar situation.

I Installed Azure CLI from .msi package

Heres contents of unencrypted account tokens

    "Account": {
        "00000000-0000-0000-7646-451e2554e8a2.9188040d-6c67-4c5b-b112-36a304b66dad-login.microsoftonline.com-organizations": {
            "home_account_id": "00000000-0000-0000-7646-451e2554e8a2.9188040d-6c67-4c5b-b112-36a304b66dad",
            "environment": "login.microsoftonline.com",
            "realm": "organizations",
            "local_account_id": "mxZ7AZSUax9B16n3lwE4isegKGToyJ0ZIK1iDkfY5vQ",
            "username": "<redacted>",
            "authority_type": "MSSTS"
        },
        "237e830d-aa10-4fce-bdbc-62bf9acc8b73.98c2b1ec-775b-49fa-9ba5-1362cc916655-login.microsoftonline.com-organizations": {
            "home_account_id": "237e830d-aa10-4fce-bdbc-62bf9acc8b73.98c2b1ec-775b-49fa-9ba5-1362cc916655",
            "environment": "login.microsoftonline.com",
            "realm": "organizations",
            "local_account_id": "237e830d-aa10-4fce-bdbc-62bf9acc8b73",
            "username": "<redacted>",
            "authority_type": "MSSTS"
        }
    },

thanks

jiasli commented 3 years ago

Are the <redacted> usernames the same? It is uncommon for the same <redacted> username to have 2 district home_account_ids. +@rayluo

Tomnowell commented 3 years ago

Sorry, yes the username is the same. It's my private email address. When I log in via a browser I am asked which account I want: the one set up by me, or one set up by my IT department. As I don't have an IT department I'm not sure why they are separate. I tried to "merge" the accounts but that hasn't solved the problem.

jiasli commented 3 years ago

After discussing with MSAL developer @rayluo, we feel this is an unexpected scenario. 9188040d-6c67-4c5b-b112-36a304b66dad is the tenant ID for Microsoft Account.

I tried to log in with my own Microsoft Account and the Account field looks like:

    "Account": {
        "00000000-0000-0000-a399-d570a52cd9de.9188040d-6c67-4c5b-b112-36a304b66dad-login.microsoftonline.com-organizations": {
            "home_account_id": "00000000-0000-0000-a399-d570a52cd9de.9188040d-6c67-4c5b-b112-36a304b66dad",
            "environment": "login.microsoftonline.com",
            "realm": "organizations",
            "local_account_id": "hfwAXfMGhps2MGbpc70lxh7wAMljXr6y1wqiSvvMfnw",
            "username": "myname@outlook.com",
            "authority_type": "MSSTS"
        }
    },

However, in your case, the same email address is also an AAD account, because it has a full "home_account_id": "237e830d-aa10-4fce-bdbc-62bf9acc8b73.98c2b1ec-775b-49fa-9ba5-1362cc916655".

For now, the solution would be to clear the Azure CLI storage and MSAL token cache, then re-login with only one account:

az account clear
az login

I believe this is how @dylankdreyer78 solved this issue.

To better help us understand your account configuration, would you mind sending a screenshot of your AAD login page to my email address <my_github_username>@microsoft.com? We can then help you on this issue privately.

Thanks a lot for the information.

spottedmahn commented 3 years ago

Do you mind letting us know what action you have performed?

I got a personal & work account w/ the same email / username... I logged in w/ one & get that message on az provider register --namespace Microsoft.Web 🤷‍♂️

I've emailed you my powershell session, if that helps.

jiasli commented 3 years ago

I got a personal & work account w/ the same email / username...

I am not sure if this due to some historical reason, but currently I am not able to create Microsoft Account with work or school account email:

image

@microsoft.com is also reserved.

image

jiasli commented 3 years ago

@spottedmahn, thanks for the email. Apparently, az account clear and az login have helped solve the "Found multiple accounts with the same username" issue.

However, your last problem doesn't seem to be related to this issue, it is rather a problem with az provider register:

> az provider register --namespace Microsoft.Web
Registering is still on-going. You can monitor using 'az provider show -n Microsoft.Web'

As the error suggests, the registration is on-going and it should complete in a while. If you still see any problem with this command, could you create a new issue? Thanks.

spottedmahn commented 3 years ago

However, your last problem doesn't seem to be related to this issue

I figured not, thanks 👍

jiasli commented 3 years ago

Solution

To get unblocked, please clear Azure CLI's accounts and log in again with only one account (Microsoft Account or AAD Account):

az account clear
az login

Later if you want to logging in again, please make sure to select the same account, but not the other one.

jiasli commented 3 years ago

A little more context:

Previously, ADAL raises an exception when multiple tokens are found for the same username:

https://github.com/AzureAD/azure-activedirectory-library-for-python/blob/1.2.7/adal/cache_driver.py#L123-L124

                raise AdalError('More than one token matches the criteria. The result is ambiguous.')

This was reported at #5548, #6147, #6957, #15320 (search link).

CitypassengerIT commented 3 years ago

Locked => account no more duplicated : "state": "Enabled",

jiasli commented 3 years ago

@CitypassengerIT, "state": "Enabled" is from ~/.azure/azureProfile.json indicating the subscription is enabled. It has nothing to do with the MSAL token cache ~/.azure/msal_token_cache.bin (encrypted) or ~/.azure/msal_token_cache.json which is the direct cause of this "multiple accounts" error.

jiasli commented 2 years ago

According to the search on "sandbox multiple accounts" and "learn multiple accounts", several issues are caused by Microsoft Learn sandbox account:

Found these resources for Microsoft Learn sandbox:

We will do some investigation about this topic.

johanchen commented 2 years ago

@dylankdreyer78, I am glad to know it works for you. Do you mind letting us know what action you have performed? Thanks a lot.

For me, this below command solved the same issue highlighted by @dylankdreyer78 az config set core.token_encryption=false

rayluo commented 2 years ago

@dylankdreyer78, I am glad to know it works for you. Do you mind letting us know what action you have performed? Thanks a lot.

For me, this below command solved the same issue highlighted by @dylankdreyer78 az config set core.token_encryption=false

@johanchen , I would assume your statement above was not precise. The situation we know so far is:

deeTEEcee commented 2 years ago

If it helps, I ran into this too and this was because during login, I have two accounts registered to the same email: one was the work account and one was identified as personal account. The latter I might've made just while being confused by the process of sync'ing my email with our azure stuff.

So I would do az login with the personal email and that one would fail. I would attempt it again and use the work one but then run into this issue.

mcclung commented 2 years ago

Last night I was using microsoft learn to create a sandbox. The sandbox creation failed initially, but I was left with an account that is not signed into my normal PAYG subscription. At some point I visited aad.portal.azure.com and during the log in process things started to go wrong. The CLI (version I installed with Gentoo Linux) gave me this:

$ az login
The default web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.
Opening in existing browser session.
[19176:19176:0100/000000.166713:ERROR:vaapi_wrapper.cc(1119)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[19176:19176:0100/000000.166756:ERROR:vaapi_wrapper.cc(1066)] FillProfileInfo_Locked failed for va_profile VAProfileH264Main and entrypoint VAEntrypointVLD
[19176:19176:0100/000000.166786:ERROR:vaapi_wrapper.cc(1119)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[19176:19176:0100/000000.166809:ERROR:vaapi_wrapper.cc(1066)] FillProfileInfo_Locked failed for va_profile VAProfileH264High and entrypoint VAEntrypointVLD
Found multiple accounts with the same username 'scott@mcclung.com': [{'home_account_id': '00000000-0000-0000-baf4-282f003203cd.9188040d-6c67-4c5b-b112-36a304b66dad', 'environment': 'login.microsoftonline.com', 'username': 'scott@mcclung.com', 'authority_type': 'MSSTS', 'local_account_id': 'eRI7YFbzT2A78sky0As1Ix6SDHNqwM3-satLWHHKM5c', 'realm': 'organizations'}, {'home_account_id': '35d7b220-2b2d-4b82-a5a1-2e8f2907fd79.a9bc815e-e46f-4c95-9c96-bc46c4d342b5', 'environment': 'login.microsoftonline.com', 'username': 'scott@mcclung.com', 'authority_type': 'MSSTS', 'local_account_id': '35d7b220-2b2d-4b82-a5a1-2e8f2907fd79', 'realm': 'organizations'}]
Please report to us via Github: https://github.com/Azure/azure-cli/issues/20168

I deleted ~/.azure and started over and got the right login this time:

[
  {
    "cloudName": "AzureCloud",
    "homeTenantId": "5b234a67-1ad7-4021-9056-328b95f63810",
    "id": "e8868903-7f75-40d3-8cf6-9ac1a3fbd5c1",
    "isDefault": true,
    "managedByTenants": [],
    "name": "Azure subscription 1",
    "state": "Enabled",
    "tenantId": "5b234a67-1ad7-4021-9056-328b95f63810",
    "user": {
      "name": "scott@mcclung.com",
      "type": "user"
    }
  },
  {
    "cloudName": "AzureCloud",
    "homeTenantId": "5b234a67-1ad7-4021-9056-328b95f63810",
    "id": "aa79e39f-b196-4705-9073-85746c273a97",
    "isDefault": false,
    "managedByTenants": [],
    "name": "Azure Testing",
    "state": "Disabled",
    "tenantId": "5b234a67-1ad7-4021-9056-328b95f63810",
    "user": {
      "name": "scott@mcclung.com",
      "type": "user"
    }
  }
]

That "Azure Testing" AAD was something I created for learning, and I haven't yet figured out how to get rid of it entirely, but it's not the problem. The "wrong" account has no subscription at all.

hholst80 commented 2 years ago
az login --scope https://management.core.windows.net//.default                                                                                                                          1s  ↑ ● ✭  /w/p/func 
The default web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.
Found multiple accounts with the same username 'henrik.holst@omnimodular.com': [{'home_account_id': '00000000-0000-0000-264e-78290da16ac9.9188040d-6c67-4c5b-b112-36a304b66dad', 'environment': 'login.microsoftonline.com', 'username': 'henrik.holst@omnimodular.com', 'authority_type': 'MSSTS', 'local_account_id': 'j9JJHpDOi4FGDuOcQR1b5swb3l2zqzR_Oq-fJeRqSv0', 'realm': 'organizations'}, {'home_account_id': 'e6a15801-6e30-4899-82ae-835a74ed6c94.6e9a4299-1b35-4929-a311-367ea51939d6', 'environment': 'login.microsoftonline.com', 'username': 'henrik.holst@omnimodular.com', 'authority_type': 'MSSTS', 'local_account_id': 'e6a15801-6e30-4899-82ae-835a74ed6c94', 'realm': 'organizations'}]
Please report to us via Github: https://github.com/Azure/azure-cli/issues/20168

I just moved my ~/.azure directory out of the way and ran the command again. Now it worked.

alan994 commented 2 years ago

Hi guys, it seems I have same problem :( I installed Azure CLI on my Ubuntu box. Standard installation from docs.

When I tried to run az login I got the error from the first post. After running az account clear and then az login it works ok and I was able to set my account subscription az account set --subscription <subscription_name>. Next step for me is to runaz acr login -n ` this command should work without problem but it asks me my credentials and after I enter my credentials I got folowing error.

sudo az acr login -n <my_container_registry_name>                                                                                                  ─╯
Unable to get AAD authorization tokens with message: Please run 'az login' to setup account.
Unable to get admin user credentials with message: Please run 'az login' to setup account.
Username: <my_email>
Password: 
Error response from daemon: Get "https://<my_registry_name>.azurecr.io/v2/": unauthorized: Application not registered with AAD.
Login failed.

Any help with this?

jiasli commented 2 years ago

@alan994, your issue regarding az acr login is a separate one. I have split it into https://github.com/Azure/azure-cli/issues/21083 and asked ACR service team to take a look.

mgrazebrook commented 2 years ago

Same problem. I set up a starter Azure account with $200 credit. All fine for a few days. Then I had weird login problems. Then I could login but could not see my subscription. Support reported " I see that it is recognized as a “Personal Account” and as well as “Work or School Account”" and gave instructions starting "Open Edge browser | InPrivate mode" which I followed (but using Chrome/Incognito). I can now only see my account in Incognito mode.

Using az login from the command line (I'm doing a CLI training module), I get a message:

Found multiple accounts with the same username 'michael@grazebrook.com': 
(snip 2 records - I imagine it's insecure to publish the values!)
Please report to us via Github: https://github.com/Azure/azure-cli/issues/20168
blue928 commented 2 years ago

This is URGENT. Please advise steps to regain access to my professional work and workspace.

I have had a Microsoft account for personal use / xbox for years. I signed up for DevOps and other technology services with the same email that I accessed through portal.azure.com. Created a significant amount of work over the past several weeks. Today, I was asked to change my password. When I did, I got several errors which led me here. I finally clicked through enough buttons that when I got to portal.azure.com, where I previously saw my technology resources (mysql server, kubernetes, etc), I now see my PERSONAL info that discusses my xbox subscription, family account stuff, etc.

az login or az login -t <my professional tenant id> all lead to login loops.

I've lost access to ALL my professional work and have no idea how to get back. I've deleted the .azure folder; I've ran az account clear; nothing works. Please advise!

This is the error I keep getting:

Found multiple accounts with the same username 'myname@myemail.com': [{'home_account_id': '00000000-0000-0000-d399-d6d1d4a4ca7a.9188040d-6c67-4c5b-b112-36a304b66dad', 'environment': 'login.microsoftonline.com', 'username': 'myname@myemail.com', 'authority_type': 'MSSTS', 'local_account_id': '618057b1-4c21-4e36-b684-03135cbcbed3', 'realm': '0457c22a-03ab-4ceb-8e26-391ef8087bc2'}, {'home_account_id': 'b9d64a87-8413-4861-8cce-40ad8f530962.30ff9873-366e-4653-8ff0-63f6d2ebf293', 'environment': 'login.microsoftonline.com', 'username': 'myname@myemail.com, 'authority_type': 'MSSTS', 'local_account_id': 'GAmuQnC8tFfz0fRU6JAQy7FjmpWT4l5zIQdT1tVPhRE', 'realm': '0457c22a-03ab-4ceb-8e26-391ef8087bc2'}]
Please report to us via Github: https://github.com/Azure/azure-cli/issues/20168
jiasli commented 2 years ago

@blue928,

I finally clicked through enough buttons that when I got to portal.azure.com, where I previously saw my technology resources (mysql server, kubernetes, etc), I now see my PERSONAL info that discusses my xbox subscription, family account stuff, etc.

Based on my understanding, you cannot sign in to Azure Portal either, right? For that case, could you clear the browser cache or use InPrivate or Incognito mode?

I've deleted the .azure folder; I've ran az account clear; nothing works.

After clearing the browser cache, run az account clear and az login, but only select the account you use to access Azure resources, and see if the error is gone.

robch commented 2 years ago

I ran into this same issue. How can I fix it?

yonzhan commented 2 years ago

Please adopt the approach suggested in the last comment.

AdamDudley commented 2 years ago

Hope this helps.

Steps to reproduce

  1. az login
  2. choose your 'work' account for the email address
  3. az account set -s "subscription"
  4. choose the different account (personal) for the same email address as 2.
  5. get the error

fix is

az account clear
az login

and use the same 'account' for the email address each time... user error, no bug here.

c240amg commented 2 years ago

The above works for me. Issue in my case was caused by a tenancy migration

vnomus commented 2 years ago

Same issue here, but above solution does not work for me. If, when I'm presented with the two matching accounts to chose from during login (after clearing account):

  1. Work account - I get a "No subscription found error".
  2. Personal account - logs in ok and I can see my MSDN subscription. However, I can no longer download from the artifacts repository created by that subscription. (I can still access (see) it in the browser) e.g Failed to update Universal Packages tooling. TF400813: The user 'a1565184-2cfd-6fb0-8841-54cc8d70383e' is not authorized to access this resource.
wmeints commented 2 years ago

Same issue here! I deleted the token cache and was able to login as normal. I have one personal account and a work account with the same name. Can't rename them or else my MVP profile becomes inaccessible :(

Mastansourcefuse commented 2 years ago

Found multiple accounts with the same username 'sk.mastan@sourcefuse.com': [{'home_account_id': '4cc03aea-8a4c-4092-a20a-9b3653079ed2.a86a5cb3-752e-49a9-82e6-dd80ee4bf2c2', 'environment': 'login.microsoftonline.com', 'username': 'sk.mastan@sourcefuse.com', 'authority_type': 'MSSTS', 'local_account_id': '4cc03aea-8a4c-4092-a20a-9b3653079ed2', 'realm': 'organizations'}, {'home_account_id': '263e78d2-19cf-48dc-a8f0-6f478b71fcbc.ddb21e3d-29dd-4280-a4dd-d05a97bc050c', 'environment': 'login.microsoftonline.com', 'username': 'sk.mastan@sourcefuse.com', 'authority_type': 'MSSTS', 'local_account_id': '263e78d2-19cf-48dc-a8f0-6f478b71fcbc', 'realm': 'organizations'}]

Revlig commented 1 year ago

No problem. I deleted the json files in the .azure directory :)

same here :D

Rakigh commented 1 year ago

Found multiple accounts with the same username 'sk.mastan@sourcefuse.com': [{'home_account_id': '4cc03aea-8a4c-4092-a20a-9b3653079ed2.a86a5cb3-752e-49a9-82e6-dd80ee4bf2c2', 'environment': 'login.microsoftonline.com', 'username': 'sk.mastan@sourcefuse.com', 'authority_type': 'MSSTS', 'local_account_id': '4cc03aea-8a4c-4092-a20a-9b3653079ed2', 'realm': 'organizations'}, {'home_account_id': '263e78d2-19cf-48dc-a8f0-6f478b71fcbc.ddb21e3d-29dd-4280-a4dd-d05a97bc050c', 'environment': 'login.microsoftonline.com', 'username': 'sk.mastan@sourcefuse.com', 'authority_type': 'MSSTS', 'local_account_id': '263e78d2-19cf-48dc-a8f0-6f478b71fcbc', 'realm': 'organizations'}]

Did you get the solution for this

Rakigh commented 1 year ago

Even i am facing the same problem.

On Wed, 14 Dec 2022, 9:58 pm Ben Exell, @.***> wrote:

Hello! Im this error too! I set my default browser to Edge and deleted all cache & cookies. Still the same error after login attempt. Any help appreciated [image: image] https://user-images.githubusercontent.com/52918186/207651181-d4f31490-acf1-4152-aa91-44555d1549c0.png

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-cli/issues/20168#issuecomment-1351730440, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4UXOE74JRNOSG3TZNKLNVDWNHYTFANCNFSM5HILCEQA . You are receiving this because you commented.Message ID: @.***>

jrthib commented 1 year ago

Same issue here as well

joestringer commented 1 year ago

I started having this problem today. I moved/deleted ~/.azure and it resolved the problem.

Aki-Siponen commented 1 year ago

Hi, As requested I'll report the issue:

Found multiple accounts with the same username 'aki@siponen.fi': [{'home_account_id': 'ad1fb935-c50f-4b07-8ebe-bc82f2efedd0.58a40091-38c3-4621-884a-026b6b95bd1e', 'environment': 'login.microsoftonline.com', 'username': 'aki@siponen.fi', 'authority_type': 'MSSTS', 'local_account_id': 'ad1fb935-c50f-4b07-8ebe-bc82f2efedd0', 'realm': 'organizations'}, {'home_account_id': '00000000-0000-0000-726c-8ac3fed1fb58.9188040d-6c67-4c5b-b112-36a304b66dad', 'environment': 'login.microsoftonline.com', 'username': 'aki@siponen.fi', 'authority_type': 'MSSTS', 'local_account_id': 'DUPZnRKweTkgq6RDJjgL-c16xu7aNUG8dUQQd0aFxrg', 'realm': 'organizations'}]
Please report to us via Github: https://github.com/Azure/azure-cli/issues/20168

when logging in to Azure CLI in VS Code PowerShell. az account clear solved the issue and I could log in. Thank you for the advice!

One of those accounts is Microsoft account and the other is work/school account for my private domain.

I see that there is some discussion about how this is possible. There is at least one possible workflow to create the situation. I don't know if this is still possible. I think it is:

  1. set up a domain, let's say mydomain.com
  2. use Google or some other email provider for the domain
  3. create email myname@mydomain.com
  4. create a Microsoft account using the email myname@mydomain.com
  5. purchase Microsoft 365, you get domain mydomain.onmicrosoft.com
  6. transfer your domain (mydomain.com) and email to Microsoft 365
  7. now you have a work email myname@mydomain.com

I did this in 2008 - 2011.

jmleddy commented 1 year ago

Turning off token encryption and removing the token cache file resolved it for me as well. On mac rm ~/.azure/msal_token_cache.json

rayluo commented 1 year ago

Turning off token encryption and removing the token cache file resolved it for me as well. On mac rm ~/.azure/msal_token_cache.json

While you are removing the token cache file anyway, the token encryption is irrelevant. Besides, I believe Azure CLI does not yet encrypt tokens on mac.

robch commented 1 year ago

Reporting as requested:

image

JamesMHerrington commented 1 year ago

Reporting as directed:

Found multiple accounts with the same username 'JamesM.Herrington@am.jll.com': [{'home_account_id': '1d2573cc-12cf-45ab-b3c3-166139d7f7a9.bfef2b06-d256-4f8e-bd03-8d3687987063', 'environment': 'login.microsoftonline.com', 'username': 'JamesM.Herrington@am.jll.com', 'authority_type': 'MSSTS', 'local_account_id': '1d2573cc-12cf-45ab-b3c3-166139d7f7a9', 'realm': 'organizations'}, {'home_account_id': '00000000-0000-0000-de1b-4e5a5c2478ff.9188040d-6c67-4c5b-b112-36a304b66dad', 'environment': 'login.microsoftonline.com', 'username': 'JamesM.Herrington@am.jll.com', 'authority_type': 'MSSTS', 'local_account_id': '00000000-0000-0000-de1b-4e5a5c2478ff.9188040d-6c67-4c5b-b112-36a304b66dad.f8cdef31-a31e-4b4a-93e4-5f571e91255a', 'realm': 'organizations'}

ehershey commented 1 year ago

I got this error too.

Found multiple accounts with the same username 'ernie.hershey@xxx': [{'home_account_id': 'xxx', 'environment': 'login.microsoftonline.com', 'username': 'ernie.hershey@xxx', 'authority_type': 'MSSTS', 'local_account_id': 'xxx', 'realm': 'organizations'}, {'home_account_id': 'xxx', 'environment': 'login.microsoftonline.com', 'username': 'ernie.hershey@xxx', 'authority_type': 'MSSTS', 'local_account_id': 'xxx', 'realm': 'organizations'}]
craigmj commented 1 year ago

Reporting as directed: Found multiple accounts with the same username 'craig@lateral.co.za': [{'home_account_id': '00000000-0000-0000-226c-4e0a43c67914.9188040d-6c67-4c5b-b112-36a304b66dad', 'environment': 'login.microsoftonline.com', 'username': 'craig@lateral.co.za', 'authority_type': 'MSSTS', 'local_account_id': 'kISun9DEDcR3pNu7H8kd4CS8PbJ0XXkmW2yMvziPqiQ', 'realm': 'organizations'}, {'home_account_id': '3eec8dab-c90d-4871-a539-bf53a88f25ad.589bcab5-cea5-4eaa-ba34-9e58b9d21b40', 'environment': 'login.microsoftonline.com', 'username': 'craig@lateral.co.za', 'authority_type': 'MSSTS', 'local_account_id': '3eec8dab-c90d-4871-a539-bf53a88f25ad', 'realm': 'organizations'}] Please report to us via Github: https://github.com/Azure/azure-cli/issues/20168

I need this resolved asap. I've got a client who won't have any service until I can access the cloud again...

pwae commented 1 year ago

I had this issue too. As a summary, we previously used Personal MS accounts (with our work email) to sign in. We then migrated from that to Azure AD, and migrate the devops tenant.

I suspect this is related as to why the errors occur.