AbstractAuthentication Class

Abstract parent class for all authentication classes in Azure Machine Learning.

Derived classes provide different means to authenticate and acquire a token based on their targeted use case. For examples of authentication, see https://aka.ms/aml-notebook-auth.

Class AbstractAuthentication constructor.

Inheritance
builtins.object
AbstractAuthentication

Constructor

AbstractAuthentication(cloud=None)

Parameters

cloud
str
default value: None

The name of the target cloud. Can be one of "AzureCloud", "AzureChinaCloud", or "AzureUSGovernment". If no cloud is specified, any configured default from the Azure CLI is used. If no default is found, "AzureCloud" is used.

cloud
str
Required

The name of the target cloud. Can be one of "AzureCloud", "AzureChinaCloud", or "AzureUSGovernment". If no cloud is specified, any configured default from the Azure CLI is used. If no default is found, "AzureCloud" is used.

Methods

get_authentication_header

Return the HTTP authorization header.

The authorization header contains the user access token for access authorization against the service.

get_token

Contract for Track 2 SDKs to get token.

Currently supports Auth classes with self.get_authentication_header function implemented.

signed_session

Add the authorization header as a persisted header on an HTTP session.

Any new requests sent by the session will contain the authorization header.

get_authentication_header

Return the HTTP authorization header.

The authorization header contains the user access token for access authorization against the service.

get_authentication_header()

Returns

Returns the HTTP authorization header.

Return type

get_token

Contract for Track 2 SDKs to get token.

Currently supports Auth classes with self.get_authentication_header function implemented.

get_token(*scopes, **kwargs)

Parameters

scopes
Required

Args.

kwargs
Required

Kwargs.

Returns

Returns a named tuple.

Return type

signed_session

Add the authorization header as a persisted header on an HTTP session.

Any new requests sent by the session will contain the authorization header.

signed_session(session=None)

Parameters

session
<xref:requests.sessions.Session>
default value: None

The HTTP session that will have the authorization header as a default persisted header. When None, a new session is created.

Returns

Returns the HTTP session after the update.

Return type

<xref:requests.sessions.Session>