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.objectAbstractAuthentication
Constructor
AbstractAuthentication(cloud=None)
Parameters
Name | Description |
---|---|
cloud
|
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. Default value: None
|
cloud
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
Type | Description |
---|---|
Returns the HTTP authorization header. |
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
Name | Description |
---|---|
scopes
Required
|
Args. |
kwargs
Required
|
Kwargs. |
Returns
Type | Description |
---|---|
Returns a named tuple. |
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
Name | Description |
---|---|
session
|
<xref:requests.sessions.Session>
The HTTP session that will have the authorization header as a default persisted header. When None, a new session is created. Default value: None
|
Returns
Type | Description |
---|---|
<xref:requests.sessions.Session>
|
Returns the HTTP session after the update. |