TokenCredential class
Definition
Represents a token credential that is used to authorize HTTPS requests. The token can be updated by the user.
TokenCredential(initial_value=None)
- Inheritance
-
builtins.objectTokenCredential
Variables
- token
- str
Methods
| signed_session |
Sign requests session with the token. This method is called every time a request is going on the wire. The user is responsible for updating the token with the preferred tool/SDK. In general there are two options:
The second option is recommended as it tends to be more performance-friendly. |
| token |
signed_session
Sign requests session with the token. This method is called every time a request is going on the wire. The user is responsible for updating the token with the preferred tool/SDK. In general there are two options:
override this method to update the token in a preferred way and set Authorization header on session
not override this method, and have a timer that triggers periodically to update the token on this class
The second option is recommended as it tends to be more performance-friendly.
signed_session(session=None)
Parameters
- session
- requests.Session
The session to configure for authentication
Return type
token
token(new_value)
Parameters
- new_value
new value to be set as the token.