django-cognito-jwt-rydra

Django backends for AWS Cognito JWT (Forked from django-cognito-jwt with some customizations)


License
MIT
Install
pip install django-cognito-jwt-rydra==0.0.4

Documentation

django-cognito-jwt

An Authentication backend for Django Rest Framework for AWS Cognito JWT tokens

Status

https://travis-ci.org/LabD/django-cognito-jwt.svg?branch=master http://codecov.io/github/LabD/django-cognito-jwt/coverage.svg?branch=master

Installation

pip install django-cognito-jwt

Usage

Add the following lines to your Django settings.py file:

COGNITO_AWS_REGION = '<aws region>' # 'eu-central-1'
COGNITO_USER_POOL = '<user pool>'   # 'eu-central-1_xYzaq'
COGNITO_AUDIENCE = '<client id>'

Also update the rest framework settings to use the correct authentication backend:

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': [
        ...
        'django_cognito_jwt.JSONWebTokenAuthentication',
       ...
    ],
    ...
 }