django-cognito-jwt¶
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',
...
],
...
}