Home > Enterprise >  Access data without token Django simple_jwt lib
Access data without token Django simple_jwt lib

Time:09-08

I am using django simple_jwt library with DRF for a React project. Everything is working well except I cannot access any data (even simple GET requests) if no access token is provided. I didn't find a way to do it in the docs , is there some kind of decorator, setting to allow simple requests without an access token? Many thanks

CodePudding user response:

If you want to access apis without token , make them public. By default all the api requests are required to be authenticated in your case currently.

Sample:

from rest_framework import permissions

class ExampleApi(APIView):
    permission_classes = [permissions.AllowAny]
    authentication_classes = []
  • Related