flask_cognitologin package¶
Submodules¶
flask_cognitologin.cognitologin module¶
Main module.
-
class
flask_cognitologin.cognitologin.CognitoLogin(app=None)[source]¶ Bases:
object-
property
JWKS¶
-
checkIdentity(identity)[source]¶ Check identity claims
If the current identity is about to expire a new one will be emitted.
If
identitydoes not hasexpandrefresh_tokenkeys this returnsNone- Parameters
identity (dict) – current user identity claims
- Returns
identity
- Return type
dict
-
getIdentity()[source]¶ Process cognito autorization code grant
- Returns
the user identity or None
- Return type
dict
-
getTokens(refresh_token)[source]¶ Returns the
id_tokenandaccess_token- Parameters
refresh_token (str) – refresh token for the user
- Returns
a
dictwith the keysid_tokenandaccess_token- Return type
dict
-
init_app(app)[source]¶ Initialize the extension
This extension need session so the
SECRET_KEYshould be configured:app.config['SECRET_KEY'] = 'some-secret-of-my-own'
You also need:
AWS_REGION: aws region of your cognito user poolCOGNITO_POOL_ID: Cognito user pool IDCOGNITO_DOMAIN: this is the full hostname of the cognito domain for example,mycogdomain.auth.eu-west-1.amazoncognito.com, refer to aws documentationCOGNITO_CLIENT_ID: Your cognito client IDCOGNITO_CALLBACK_URL: URL for the autorization code grant, cognito will call to this URL with the user tokensCOGNITO_CLIENT_SECRET: Your cognito client secret
- Raises
ValueError – if the config keys are missing
-
property
Module contents¶
Top-level package for Flask-CognitoLogin.
-
class
flask_cognitologin.CognitoLogin(app=None)[source]¶ Bases:
object-
property
JWKS¶
-
checkIdentity(identity)[source]¶ Check identity claims
If the current identity is about to expire a new one will be emitted.
If
identitydoes not hasexpandrefresh_tokenkeys this returnsNone- Parameters
identity (dict) – current user identity claims
- Returns
identity
- Return type
dict
-
getIdentity()[source]¶ Process cognito autorization code grant
- Returns
the user identity or None
- Return type
dict
-
getTokens(refresh_token)[source]¶ Returns the
id_tokenandaccess_token- Parameters
refresh_token (str) – refresh token for the user
- Returns
a
dictwith the keysid_tokenandaccess_token- Return type
dict
-
init_app(app)[source]¶ Initialize the extension
This extension need session so the
SECRET_KEYshould be configured:app.config['SECRET_KEY'] = 'some-secret-of-my-own'
You also need:
AWS_REGION: aws region of your cognito user poolCOGNITO_POOL_ID: Cognito user pool IDCOGNITO_DOMAIN: this is the full hostname of the cognito domain for example,mycogdomain.auth.eu-west-1.amazoncognito.com, refer to aws documentationCOGNITO_CLIENT_ID: Your cognito client IDCOGNITO_CALLBACK_URL: URL for the autorization code grant, cognito will call to this URL with the user tokensCOGNITO_CLIENT_SECRET: Your cognito client secret
- Raises
ValueError – if the config keys are missing
-
property