galileo_sdk.sdk.auth.AuthSdk¶
- class galileo_sdk.sdk.auth.AuthSdk(client_id='oDmH6Nf4DN3oILcNk7cQqBchXUfv7fpD', audience='')[source]¶
Helper class for user authentication.
- __init__(client_id='oDmH6Nf4DN3oILcNk7cQqBchXUfv7fpD', audience='')[source]¶
Constructor for AuthSdk class.
- Parameters
client_id – string: Optional argument for tracking which integration is calling the sdk.
mode – string: Optional argument, can be prod (default) or dev.
audience – string: Optional argument
- Returns
AuthSdk
- Example:
>>> from galileo_sdk import GalileoSdk, AuthSdk >>> myauth = AuthSdk() >>> access_token, refresh_token, expiry_time = myauth.initialize() >>> galileo = GalileoSdk(auth_token=access_token, refresh_token=refresh_token)
Methods
__delattr__
(name, /)Implement delattr(self, name).
__dir__
()Default dir() implementation.
__eq__
(value, /)Return self==value.
__format__
(format_spec, /)Default object formatter.
__ge__
(value, /)Return self>=value.
__getattribute__
(name, /)Return getattr(self, name).
__gt__
(value, /)Return self>value.
__hash__
()Return hash(self).
__init__
([client_id, audience])Constructor for AuthSdk class.
__init_subclass__
This method is called when a class is subclassed.
__le__
(value, /)Return self<=value.
__lt__
(value, /)Return self<value.
__ne__
(value, /)Return self!=value.
__new__
(**kwargs)__reduce__
()Helper for pickle.
__reduce_ex__
(protocol, /)Helper for pickle.
__repr__
()Return repr(self).
__setattr__
(name, value, /)Implement setattr(self, name, value).
__sizeof__
()Size of object in memory, in bytes.
__str__
()Return str(self).
__subclasshook__
Abstract classes can override this to customize issubclass().
_get_new_access_token
(refresh_token, …)- param refresh_token
string: refresh token.
_poll_for_tokens
(interval, device_code)- param interval
string: time in seconds between polling for tokens.
_request_device_authorization
()- return
Tuple containing the user_url, user_code, device_code, interval, and complete_url.
_store_token_info
(refresh_token, expires_in, …)- param refresh_token
string: refresh token.
datetime_converter
(o)- param o
object: Object to convert to datetime.
device_flow
([refresh_token_path])Attempts to bring up a webbrowser for the user to authenticate.
initialize
([refresh_token_path])Automatically authenticate the user either through a webbrowser or auth-link printed to the terminal.
refresh_token_file_flow
(refresh_token_file)Refreshes access token if given the location of a refresh token file.
refresh_token_flow
(refresh_token, expires_in)Refreshes access token if given a refresh token.
show_user_code
(user_code)Attributes
__dict__
__doc__
__module__
__weakref__
list of weak references to the object (if defined)