OAuthTokenAuthentication Class
OAuth Token Authentication.
Requires that supplied token contains an expires_in field.
- Inheritance
-
OAuthTokenAuthentication
Constructor
OAuthTokenAuthentication(client_id: str, token: Dict[str, str])
Parameters
Methods
| construct_auth |
Format token header. |
| refresh_session |
Return updated session if token has expired, attempts to refresh using refresh token. If a session object is provided, configure it directly. Otherwise, create a new session and return it. |
| signed_session |
Create requests session with any required auth headers applied. If a session object is provided, configure it directly. Otherwise, create a new session and return it. |
construct_auth
refresh_session
Return updated session if token has expired, attempts to refresh using refresh token.
If a session object is provided, configure it directly. Otherwise, create a new session and return it.
refresh_session(session: Optional[requests.sessions.Session] = None) -> requests.sessions.Session
Parameters
- session
- <xref:requests.Session>
The session to configure for authentication
Return type
signed_session
Create requests session with any required auth headers applied.
If a session object is provided, configure it directly. Otherwise, create a new session and return it.
signed_session(session: Optional[requests.sessions.Session] = None) -> requests.sessions.Session
Parameters
- session
- <xref:requests.Session>
The session to configure for authentication
Return type
Feedback
Submit and view feedback for