Skip to content

Instantly share code, notes, and snippets.

@PaulCreusy
Created June 15, 2024 08:56
Show Gist options
  • Save PaulCreusy/52b69ce96ce76fcf8dbe06136a3ce91f to your computer and use it in GitHub Desktop.
Save PaulCreusy/52b69ce96ce76fcf8dbe06136a3ce91f to your computer and use it in GitHub Desktop.
Azure connection protocol for username and password
from azure.identity import UsernamePasswordCredential
credential = UsernamePasswordCredential(
client_id="client_id_found_in_azure",
username="email",
password="password",
)
print(credential.get_token("https://graph.microsoft.com/.default"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment