sdk.lusid.extensions.refreshing_token.RefreshingToken

class RefreshingToken(api_configuration, expiry_offset=60, id_provider_response_handler=None)[source]

Implementation of UserString that will automatically refresh the token value upon expiry

Parameters:
  • api_configuration (ApiConfiguration) – The api configuration with all required values

  • expiry_offset (int) – number of seconds before token expiry to refresh the token

  • id_provider_response_handler (callable) – A handler taking the Requests.Response from the identity provider

before it is consumed by the RefreshingToken, mutation of the Response is possible with this handler

Methods

capitalize

casefold

center

count

encode

endswith

expandtabs

find

format

format_map

get_access_token

Retrieves an access token from the identity provider using the credentials in the provided configuration

get_refresh_token

Retrieves an access token from the identity provider using the refresh token

index

Raises ValueError if the value is not present.

isalnum

isalpha

isascii

isdecimal

isdigit

isidentifier

islower

isnumeric

isprintable

isspace

istitle

isupper

join

ljust

lower

lstrip

maketrans

Return a translation table usable for str.translate().

partition

removeprefix

removesuffix

replace

rfind

rindex

rjust

rpartition

rsplit

rstrip

split

splitlines

startswith

strip

swapcase

title

translate

update_token_data

Updates the token data from a response from the identity provider

upper

zfill

get_access_token()[source]

Retrieves an access token from the identity provider using the credentials in the provided configuration

Returns:

The retrieved access token

get_refresh_token()[source]

Retrieves an access token from the identity provider using the refresh token

Returns:

The retrieved access token

update_token_data(id_provider_json)[source]

Updates the token data from a response from the identity provider

Parameters:

id_provider_json – The JSON to use to update the token data