Powered by Tachyonic Project Luxon Framework v1.4.0

Luxon Framework for rapid application development. (luxon)

Version

Authentication

Luxon provides a PKI authentication service

Authentication Class

class luxon.core.auth.Auth(expire=60)[source]

Authentication class.

Luxon token / authentication provider. Uses RSA private keys to sign tokens. Endpoints will require the public key to validate token authenticity.

The keys should be stored in the application root. Usually where the wsgi file is located.

Generate RSA Private/Public Key pairs:
luxon -r
Parameters:expire (int) – Token life-span in seconds. (default 60 seconds)
authenticated

Wether authenticated.

Type:bool
token

Token.

Type:str
json

Token in JSON.

Type:str
roles

Roles applied.

Type:tuple
user_id

User ID.

Type:str
user_domain

Login domain.

Type:str
tenant_id

Scope tenant context.

Type:str
domain

Scope domain context.

Type:str
clear()[source]

Clear authentication.

new(user_id, username=None, domain=None, roles=None)[source]

New Authentication token.

Parameters:
  • user_id (str) – Unique user identifier.
  • username (str) – Username (optional).
  • domain (str) – Domain (optional).
  • roles (list) – List of roles (optional).
validate()[source]

Vaidate current token.