CBSAuthMixin Class
Mixin to handle sending and refreshing CBS auth tokens.
- Inheritance
-
builtins.objectCBSAuthMixin
Constructor
CBSAuthMixin()
Methods
close_authenticator |
Close the CBS auth channel and session. |
create_authenticator |
Create the AMQP session and the CBS channel with which to negotiate the token. |
handle_token |
This function is called periodically to check the status of the current token if there is one, and request a new one if needed. If the token request fails, it will be retried according to the retry policy. A token refresh will be attempted if the token will expire soon. This function will return a tuple of two booleans. The first represents whether the token authentication has not completed within it's given timeout window. The second indicates whether the token negotiation is still in progress. |
update_token |
Update a token that is about to expire. This is specific to a particular token type, and therefore must be implemented in a child class. |
close_authenticator
Close the CBS auth channel and session.
close_authenticator()
create_authenticator
Create the AMQP session and the CBS channel with which to negotiate the token.
create_authenticator(connection, debug=False, **kwargs)
Parameters
Name | Description |
---|---|
connection
Required
|
The underlying AMQP connection on which to create the session. |
debug
|
Whether to emit network trace logging events for the CBS session. Default is False. Logging events are set at INFO level. Default value: False
|
Returns
Type | Description |
---|---|
handle_token
This function is called periodically to check the status of the current token if there is one, and request a new one if needed. If the token request fails, it will be retried according to the retry policy. A token refresh will be attempted if the token will expire soon.
This function will return a tuple of two booleans. The first represents whether the token authentication has not completed within it's given timeout window. The second indicates whether the token negotiation is still in progress.
handle_token()
Returns
Type | Description |
---|---|
Exceptions
Type | Description |
---|---|
uamqp.errors.AuthenticationException if the token authentication fails.
|
|
uamqp.errors.TokenExpired if the token has expired and cannot berefreshed.
|
update_token
Update a token that is about to expire. This is specific to a particular token type, and therefore must be implemented in a child class.
update_token()
Azure SDK for Python
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