pyrit.auth.AzureAuth#

class AzureAuth(token_scope: str, tenant_id: str = '')[source]#

Bases: Authenticator

Azure CLI Authentication.

__init__(token_scope: str, tenant_id: str = '')[source]#

Initialize Azure authentication.

Parameters:
  • token_scope (str) – The token scope for authentication.

  • tenant_id (str, optional) – The tenant ID. Defaults to “”.

Methods

__init__(token_scope[, tenant_id])

Initialize Azure authentication.

get_token()

Get the current token.

refresh_token()

Refresh the access token if it is expired.

Attributes

access_token

token

access_token: AccessToken#
get_token() str[source]#

Get the current token.

Returns:

current token

Return type:

str

refresh_token() str[source]#

Refresh the access token if it is expired.

Returns:

A token

Return type:

str