Skip to main content

orbitra.commons.auth.azure

Functions

complete_device_code_login

Complete a two-step device code login previously started with :func:start_device_code_login. Args:
  • scope: The scope to authenticate for.
  • environment: The environment to authenticate against.
Returns:
  • The authentication record persisted on success.

get_azure_access_token

Get an access token for the given scope and environment. Args:
  • scope: The scope to get an access token for.
  • environment: The environment to get an access token for.
Returns:
  • An access token for the given scope and environment.

get_azure_credential

Get a credential for the given scope and environment. Args:
  • scope: The scope to get a credential for.
  • environment: The environment to get a credential for.
  • use_device_code: If True, use device code flow. If False, use interactive browser. If None, use env var.
Returns:
  • A credential for the given scope and environment.

start_device_code_login

Start a two-step device code login without blocking. Args:
  • scope: The scope to authenticate for.
  • environment: The environment to authenticate against.
Returns:
  • The MSAL device flow, including user_code, verification_uri and message.