Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How setup AWS Cognito with djangorestframework-simplejwt #791

Open
mateuspadua opened this issue Mar 18, 2024 · 1 comment
Open

How setup AWS Cognito with djangorestframework-simplejwt #791

mateuspadua opened this issue Mar 18, 2024 · 1 comment
Labels

Comments

@mateuspadua
Copy link

mateuspadua commented Mar 18, 2024

I've been trying setup AWS Cognito using JWK_URL, but not working. Is there a way to do this?

My settings.py

SIMPLE_JWT = {
    "JWK_URL": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_XXXXXXX/.well-known/jwks.json",
    "ALGORITHM": "RS256",
    "AUDIENCE": "<my cognito app client>",
    "ISSUER": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_XXXXXXX",
}

myview.py

from rest_framework_simplejwt.authentication import JWTAuthentication

class TesteViewSet(
    mixins.ListModelMixin,
    viewsets.GenericViewSet,
):
    queryset = MyModel.objects.all()
    serializer_class = TesteSerializer
    authentication_classes = [JWTAuthentication]

What more I need to do?

Tks in advance, :)

@Andrew-Chen-Wang
Copy link
Member

Unfortunately, I'm not really familiar with AWS Cognito. Posting what you did in the end would be helpful:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants