Search code examples
django-rest-frameworkdjango-rest-framework-jwt

Django rest framework working with multiple apps


My aim is to authorize browsable API(first app) using the JWT token generated(second app). I have two apps created, 1. API - has all the data 2. Authentication - generate JWT tokens after validating the user.

Now, when I try to access the API after generating the token it says, Authentication credentials were not provided.

Trying to access the API (passing the bearer whatevertoken)

I mean, is there a way to authenticate the Browsable API using JWT token? Instead of creating a user session.


Solution

  • Passing Authorization header as,

    "Authorization: JWT token"

    authenticates the user.

    But, limits me to browse the API in a browser. Is there any way we can implement Browsable API using JWT authentication?

    UPDATE

    A thorough reading on

    1. Authentication classes
    2. Permission classes
    3. Django settings

    Helped in understanding the core concepts and apply appropriate solutions.