msaUtils Module¶
.token
¶
Attributes¶
Classes¶
MSAToken ¶
Attributes¶
credentials_exception
instance-attribute
¶
credentials_exception = HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Could not validate credentials",
headers={"WWW-Authenticate": "Bearer"},
)
Functions¶
__init__ ¶
MSAToken
PARAMETER | DESCRIPTION |
---|---|
secret_key |
The secret key to produce a Token
TYPE:
|
algorithm |
Algo to use, default
TYPE:
|
create_token
async
¶
Create a Token
PARAMETER | DESCRIPTION |
---|---|
data |
the data and content used to build the token
TYPE:
|
expire_minutes |
the time the token is valid, expires
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
encoded_jwt
|
jwt encoded token
TYPE:
|
verify_token
async
¶
Verify Token
PARAMETER | DESCRIPTION |
---|---|
token |
the token as str
TYPE:
|
RAISES | DESCRIPTION |
---|---|
JWTError
|
credentials_exception |
RETURNS | DESCRIPTION |
---|---|
token_data
|
the jwt decoded data
TYPE:
|
Created: September 24, 2022