aap_client.tokens

Classes and functions that encode, decode and verify JWT tokens

Encoded means encoded using base64, decoded tokens are json files

Members

members:
class aap_client.tokens.TokenDecoder(filename, required_claims=None)[source]

Bases: object

Decodes and verifies tokens using an x509 certificate and checking always the same claims.

Parameters:
  • filename – relative path to the file that contains the x509 certificate.
  • required_claims – list of string with the claims that need to be present in the tokens.
decode(serialized_token)[source]

Decodes and verifies a token using a determined audience

aap_client.tokens.verify_token(serialized_token, public_key, required_claims=None)[source]

Decodes and verifies a token given a certificate, the obligatory claims and a determined audience.