1
votes

I am using Django Rest Framework along with the Django oAuth toolkit.

The flow is currently:

  1. Third party application registers with the Authorization Server
  2. User uses my application oAuth2 to login into the third party application
  3. The third party application makes some requests to my server with the user's auth token in the Header 'Authorization'
  4. DOT converts the token to a user object and passes it to the request object

A view that logs application-level requests require the application id of the application that is requesting on behalf of the user. DRF and DOT documentation doesn't show how to do this. Does anyone have any ideas how to implement this flow?

1

1 Answers

2
votes

Folks, after hours of breaking my head, the solution was staring at me in the face all along!

request.auth.application

Thank you James Lin for leading me to the right answer!

Link to James Lin's answer