0

Is there a way to grant a user access to protected Django-serve HTML page using OAuth access_token provided by django-oauth-toolkit?

I'm developing a plugin for a 3rd party application where the user starts the OAuth flow through a popup window to receive an access_token required by the plugin to call our REST API. The user will later have to access a protected HTML page in our application but this page isn't accessible by OAuth as it requires authentication set up by django-allauth. This causes the user to log in twice which is not a pleasant user experience.

I've tried setting Authorization headers when accessing this HTML page using GET, but that doesn't seem to work with HTTP. Perhaps I need to create a custom middleware to handle this but I'm not sure. Wondering if anyone else out there has encountered this.

Cliff F
  • 381
  • 6
  • 14

1 Answers1

0

For anyone else facing a similar issue, this was resolved by using an access_token as a query param in the url to login to the protected HTML. A custom authentication middleware class was implemented to handle this.

Cliff F
  • 381
  • 6
  • 14