restapi.services.authentication.BaseAuthentication.fill_payload

BaseAuthentication.fill_payload(user, expiration=None, token_type=None)[source]

Informations to store inside the JWT token, starting from the user obtained from the current service

Claim attributes listed here: http://blog.apcelent.com/json-web-token-tutorial-example-python.html

TTL is measured in seconds

Parameters:
  • user (Any)

  • expiration (Optional[datetime], default: None)

  • token_type (Optional[str], default: None)

Return type:

tuple[Payload, Payload]