question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clarification in documentation for DRF and verifying access_token

See original GitHub issue

So in my app, and how I understand this should work in a microservice application, the flow is the following:

  1. User navigates to https://www.example.com/ which is a ReactJS FE.
  2. Using react-aad, they are automatically redirected to login using their Azure AD credentials for our tenant ID.
  3. This gives them the id_token and access_token.
  4. I need to send this access_token to our Django/DRF API where it needs to be verified as being authentic and thus granting client/API communication.

This is my understanding of how social authentication for microservices should work: client gets access_token, sends to API, API verifies it is authentic. This is where your library comes in and your documentation seems to verify this flow.

What I’m confused by, is in the DRF Integration section regarding the access token, the example is showing user and password. Again, it is my understanding user and password are not being sent from the ReactjS FE client, just the access_token and the API is supposed to verify it. This example seems to contradict that.

Can you clarify?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mihnsencommented, Dec 13, 2020

@marlonpatrick I set it wrong while trying to integrate it with just one application (Web only). Finally found issue and get over it. Thanks

0reactions
JonasKscommented, Jan 16, 2021

Closing in favor of #81 . Explanation is as previously mentioned in #114, and a PR has been raised (#123) to fix documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Clarification in documentation for DRF and verifying ...
I need to send this access_token to our Django/DRF API where it needs to be verified as being authentic and thus granting client/API...
Read more >
Clarifying use case scenario in documentation #274 - GitHub
The Django/DRF API needs to verify the authenticity of the access_token against Azure AD as well to grant communication between the FE and ......
Read more >
How to Implement Token Authentication using Django REST ...
In this tutorial you are going to learn how to implement Token-based authentication using Django REST Framework (DRF).
Read more >
Integrate OAuth 2 Into Your Django/DRF Back-end | Toptal
In this tutorial, you'll learn how to integrate OAuth 2 into your Django or ... These tokens are exchanged during the authentication process...
Read more >
JWT(JSON Web Token) With DRF - Medium
In this article we'll use it to authenticate users that JWT using with Django REST Framework. When the news content is created, only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found