| |
- builtins.object
-
- Authenticator
class Authenticator(builtins.object) |
|
Authenticator(auth_url: str, client_id: str, client_secret: str = None, cert_str: str = None, key_str: str = None, cert_file_path: str = None, key_file_path: str = None)
Authenticator class is implemented to retrieve and cache the authorization token from the xsuaa server
:param auth_url: URL of the authorization endpoint. Should be the full URL (including /oauth/token)
:type auth_url: str
:param client_id: client id to be used for authorization
:type client_id: str
:param client_secret: client secret to be used for authorization, either client_secret or
(cert_file_path and key_file_path) need to be provided, defaults to None
:type client_secret: str, optional
:param cert_str: certificate file content, needs to be provided alongside the key_str parameter, defaults to None
:type cert_str: str, optional
:param key_str: key file content, needs to be provided alongside the cert_str parameter, defaults to None
:type key_str: str, optional
:param cert_file_path: path to the certificate file, needs to be provided alongside the key_file_path parameter,
defaults to None
:type cert_file_path: str, optional
:param key_file_path: path to the key file, needs to be provided alongside the cert_file_path parameter,
defaults to None
:type key_file_path: str, optional |
|
Methods defined here:
- __init__(self, auth_url: str, client_id: str, client_secret: str = None, cert_str: str = None, key_str: str = None, cert_file_path: str = None, key_file_path: str = None)
- Initialize self. See help(type(self)) for accurate signature.
- get_token(self) -> str
- Retrieves the token from the xsuaa server or from cache when expiration date not reached.
:raises: class:`ai_api_client_sdk.exception.AIAPIAuthenticatorException` if an unexpected exception occurs while
trying to retrieve the token
:return: The Bearer token
:rtype: str
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |