How to get token(login) AzureAD without a browser in Python?

Chris Kim 20 Reputation points

Hello. Azure team,

I want to access AzureAD without a browser in Python.

So I have tried device code flow using the 'msal' library but I got 400 errors when it called the 'acqurie_token_by_device_flow' function.


I have checked the procedure in the 'acquire_token_by_device_flow' function. It was iterated in the token API and showed error code 70016.

How can I solve this issue? Please advise me.

I really appreciate any help you can provide.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
17,588 questions
0 comments No comments
{count} votes

Accepted answer
  1. Fabio Andrade 400 Reputation points Microsoft Employee

    Hi @Chris Kim

    Thanks for reaching out to Microsoft Q&A

    You can try using the steps from the documentation below. Let me know if that works for you.



0 additional answers

Sort by: Most helpful