Skip to content

API Token Authentication


Bases: BaseAuthentication

API Token Authentication

Provides the ability to use the API by using a token to authenticate.

Functions

authenticate_header(request)

authenticate(request)

Authentication the API session using the supplied token

Parameters:

Name Type Description Default
request object

API Request Object

required

Raises:

Type Description
AuthenticationFailed

'Token header invalid' - Authorization Header Value is not in format Token <auth-token>

AuthenticationFailed

'Token header invalid. Possibly incorrectly formatted' - Authentication header value has >1 space

AuthenticationFailed

'Invalid token header. Token string should not contain invalid characters.' - Authorization header contains non-unicode chars

Returns:

Name Type Description
None None

User not authenticated

tuple (user, token)

User authenticated

About:

This page forms part of our Project Centurion ERP.

Page Metadata
Version: ToDo: place files short git commit here
Date Created: 2024-06-29
Date Edited: 2024-07-13

Contribution:

Would You like to contribute to our Centurion ERP project? You can assist in the following ways:

 

ToDo: Add the page list of contributors