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
- cloud
- str
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
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
Args.
- kwargs
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>
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for