azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

'AADSTS50005: User tried to log in to a device from a platform (Unknown)

Open nmaarse opened this issue 5 years ago • 6 comments

Hi, when running: az account get-access-token --resource-type=ms-graph --tenant [mytenantid] i get the error: 'AADSTS50005: User tried to log in to a device from a platform (Unknown) that's currently not supported through Conditional Access policy. Supported device platforms are: iOS, Android, Mac, and Windows flavors. Trace ID: 49d4b937-43eb-4053-b62a-d88cc97a1900 Correlation ID: 482427ab-ccb1-415c-b12d-4260532f916b Timestamp: 2021-09-22 13:50:44Z To re-authenticate, please run: az login --scope https://graph.microsoft.com//.default'

my az version is:


az --version _'azure-cli 2.28.0

core 2.28.0 telemetry 1.0.6

Extensions: account 0.2.1

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users\niekm.azure\cliextensions'

Python (Windows) 3.8.9 (tags/v3.8.9:a743f81, Apr 6 2021, 13:22:56) [MSC v.1928 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Please let us know how we are doing: https://aka.ms/azureclihats and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy'_


Running az in the cloud shell in portal.azure.com i do get a token back. I'm running on windows 10Pro. Version 10.0.19043 Build 19043

I do not understand why the platform is unknown as it is windows 10.

Any clue how to solve this error?

nmaarse avatar Sep 22 '21 14:09 nmaarse

Any timeline on a response on this?

nmaarse avatar Sep 29 '21 13:09 nmaarse

@jiasli for awareness

yonzhan avatar Sep 29 '21 13:09 yonzhan

This is because ARM in your tenant doesn't require MFA but MS Graph does. This is called a "step-up". Have you tried to run the suggested command and call az account get-access-token again?

az login --scope https://graph.microsoft.com//.default'

jiasli avatar Sep 30 '21 00:09 jiasli

Hi,

sorry for the late response. I was not at work the last few weeks. What works: 'az account get-access-token' What doesn't work: -'az account get-access-token --resource-type=ms-graph' -'az account get-access-token --resource-type=ms-graph --tenant [tenantid]'

However the error i now get back is: 'AADSTS53000: Device is not in required device state: compliant. Conditional Access policy requires a compliant device, and the device is not compliant. The user must enroll their device with an approved MDM provider like Intune. Trace ID: e3526d6c-ced7-4c0c-af9b-d9cfad410600 Correlation ID: 6ba8210c-ac10-49c7-b20f-5f48d4a2a686 Timestamp: 2021-10-21 13:51:00Z'

I am in contact with our Azure AD admin to figure out what is going on. Seems things are changing and with the Access Security Policies as it is now complaining about the state, instead of providing the more specific error as mentioned above: AADSTS50005: User tried to log in to a device from a platform (Unknown) that's currently not supported through Conditional Access policy. Supported device platforms are: iOS, Android, Mac, and Windows flavors. Trace ID: 49d4b937-43eb-4053-b62a-d88cc97a1900 Correlation ID: 482427ab-ccb1-415c-b12d-4260532f916b Timestamp: 2021-09-22 13:50:44Z To re-authenticate, please run: az login --scope https://graph.microsoft.com//.default'

I have call with him next week and will provide the results here.

nmaarse avatar Oct 21 '21 13:10 nmaarse

Problem resolved it was a configuration issue of the machine i was working on.

There was a validation that the machine always connects via the company proxy. This is configured in windows proxy settings. however the az cli does not use this but uses https_proxy and http_proxy environment settings.

Once i've added those the issue was resolved.

You can close this issue. The initial error about an unknown platform did not happen again afterwards.

nmaarse avatar Oct 26 '21 13:10 nmaarse

Duplicate of #16401

jiasli avatar May 26 '22 10:05 jiasli