gws_core

Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version

AuthService

Functions
authenticate @classmethod

Authenticate a user. Return the DB user if ok, throw an exception if not ok

id_ : str
Return type : User
authenticate_from_token @classmethod
token : str
Return type : User
authenticate_user_if_token_provided @classmethod

Method for public route to authenticate user if token provided If not, the user is not authenticated and the method return None but no exception is raised

request : Request
Return type : gws_core.user.user.User | None
check_unique_code @classmethod

Use link the the token to check access for a unique code generated. return the object associated with the code

unique_code : str
Return type : User
check_user_access_token @classmethod
request : Request
Return type : User
generate_user_access_token @classmethod
id_ : str
Return type : str
generate_user_temp_access @classmethod
user_login_info : UserLoginInfo
Return type : str
get_and_check_token_from_request @classmethod
request : Request
Return type : str
get_and_refresh_user_from_space @classmethod

Check user space exists in the lab and if yes, it updates the user info

user_space : UserSpace
Return type : User
get_token_from_request @classmethod
request : Request
Return type : str | None
log_user @classmethod
user : User
response : Response
Return type : Response
login @classmethod
credentials : UserCredentialsDTO
Return type : Response
login_with_2fa @classmethod
credentials : UserCredentials2Fa
Return type : Response
logout @classmethod
Return type : JSONResponse
set_token_in_response @classmethod
token : str
expireInSeconds : int
response : Response