Library for allowing the use of AWS Cognito security in Django projects
Project description
Django Cognito Authentication
The intent of this library is to provide a package that supports Django and allows an easy implementation for replacing the default Django authentication with an AWS Cognito based authentication.
This is a fork of Alex Plants great work with the original django-cognito.
Install
pip install django-cognito-redux
AWS Credentials
This library uses boto3 which follows a specific path for determining what credentials to use. Definitely recommend reading their Configuring Credentials section.
The mechanism in which boto3 looks for credentials is to search through a list of possible locations and stop as soon as it finds credentials. The order in which Boto3 searches for credentials is:
1. Passing credentials as parameters in the boto.client() method
2. Passing credentials as parameters when creating a Session object
3. Environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION`, `AWS_PROFILE`)
4. Shared credential file (~/.aws/credentials)
5. AWS config file (~/.aws/config)
6. Assume Role provider
7. Boto2 config file (/etc/boto.cfg and ~/.boto)
8. Instance metadata service on an Amazon EC2 instance that has an IAM role configured.
It is recommended to not pass in arguments with you instantiate a new session or client. Instead use IAM roles for production, and local configuration files locally.
As an example I generally have a profile setup in my ~/.aws/credentials
, and a default region set for that profile in ~/.aws/config
.
From there I set AWS_PROFILE=profilename
as an environment variable so my app knows what to use. This allows for easy local development as well as
being able to use IAM roles in production, and not having to set a lot of environment variables.
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
Built Distribution
File details
Details for the file django-cognito-redux-1.3.0.tar.gz
.
File metadata
- Download URL: django-cognito-redux-1.3.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11bdb50a911cba194b14eb0b2821addf49d2451a870dde70628c2b5c527256cb |
|
MD5 | c65c454d98a3c48834aa811ecee2f5f3 |
|
BLAKE2b-256 | c84b64384a9f91a47528b7a9e8307c3dc7c92193d43e18b294bd89415bf0b5d0 |
File details
Details for the file django_cognito_redux-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: django_cognito_redux-1.3.0-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 661cb5302d16a2d6dc0a4632825384da07a6a72cb27af1e189339ab5bb376822 |
|
MD5 | c5d39461d9be1e6643bd4c462f1a002f |
|
BLAKE2b-256 | c0995894dbcac76d2a0a6b41707e2f01775733735f3ad752b7d5daf9aede3b36 |