xia_authenticator.authenticator.Authenticator

class xia_authenticator.authenticator.Authenticator

Bases: object

General Authenticator Definition

__init__()

Methods

__init__()

authenticate(payload, token_info)

authenticate user

parse_callback(payload)

Parse callback data and provide necessary information for create an

refresh(user_id, token_info[, user_object])

refresh information to be stored in access token

classmethod authenticate(payload: dict, token_info: dict)

authenticate user

Parameters
  • payload – Information provided by user to get authenticated

  • token_info – Information

Returns

a callback JWT if it is successful

Return type

callback_token

classmethod parse_callback(payload)

Parse callback data and provide necessary information for create an

Parameters

payload – should contain at least these two items: * token: callback token string * state: stored redirection information

Returns

User data except password token_info: information to be set in REFRESH token state: Redirect location

Return type

user_data

classmethod refresh(user_id, token_info: dict, user_object: Optional[User] = None)

refresh information to be stored in access token

Parameters
  • user_id – username

  • token_info – information from refresh token

  • user_object – Could pass directly the user_object to avoid a second load

Returns

User data except password token_info: information to be set in ACCESS token

Return type

user_profile

user_engine

Engine which manages users

alias of object