Skip to main content

Django authentication with AWS Cognito for your custom workflow

Project description

django-cognito-lowlevel

django-cognito-lowlevel is a Django package for handling authentication with AWS Cognito in a lower level way.

This package does not make any attempts at integrating with the Django user system directly. Handler for your callback function is provided for your own workflow customizations.


Installation of django-cognito-lowlevel

You can integrate django-cognito-lowlevel with your Django project using a Python virtual environment Please use pip to install at your Python virtual environment:

pip install django-cognito-lowlevel


Django settings that should and can be configured

The following variables are needed at the settings.py of your project.

Varaiable Description & example
COGNITO_USER_POOL_ID User pool ID of your AWS Cognito setup.
e.g. "eu-west-XXXXXXXX"
COGNITO_CLIENT_ID Client ID of your AWS Cognito setup.
e.g. "2vvdsdfr243rwefswe445rte5edr"
COGNITO_APP_CLIENT_SECRET Client Secret of AWS Cognito setup.
e.g. 1urj4uktvlmb0pps234234d6io8tipmrlu3se13fdssdf
COGNITO_TOKEN_URL The Token URL of your AWS Cognito setup.
e.g. "https://<xxxxxxxxxx>.auth.<eu-west-2>.amazoncognito.com/oauth2/token"
COGNIT_CALLBACK_URL_PATH Call back path redirected from AWS Cognito.
e.g. "some-folder-of-your-choice/api/cognito/userpool/callback/"
COGNITO_REDIRECT_URL Add some random delay of 1 to 30 seconds for each HTTP requests. Disable by default.
e.g.f"http://localhost:8000/{COGNIT_CALLBACK_URL_PATH}"
COGNITO_HOST The host of your AWS Cognito setup.
e.g. "<xxxxxxxxxx>.auth.<eu-west-2>.amazoncognito.com"
COGNITO_USERPOOL_REGION Default AWS Cognito region Name.
e.g."us-west-2"
COGNITO_AUTH_SUCCESS_REDIRECT_URL URL or Django URL route name of redirection upon success, after obtaining the access_token and id_token.
e.g. "landing:index"
COGNITO_AUTH_ERROR_REDIRECT_URL URL or Django URL route name of redirection upon error.
e.g."landing:error"
COGNITO_PUBLIC_KEYS_CACHE_TIMEOUT Cache time of the public keys of your AWS Cognito setup.
e.g.300

Credits & Acknowledgements

Python packages dependencies


License

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_cognito_lowlevel-0.1.11.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

django_cognito_lowlevel-0.1.11-py3-none-any.whl (10.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page