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

Chris Kim 20 Reputation points
2023-11-10T09:07:10.7466667+00:00

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.

(ref: https://github.com/Azure-Samples/ms-identity-python-devicecodeflow)

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.
22,536 questions
0 comments No comments
{count} votes

Accepted answer
  1. Fabio Andrade 1,665 Reputation points Microsoft Employee
    2023-11-10T23:24:13.7166667+00:00

    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.

    https://learn.microsoft.com/en-us/information-protection/develop/concept-authentication-acquire-token-py

    Thanks,

    Fabio


0 additional answers

Sort by: Most helpful

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.