1

I'm working with two servers, one a NodeJS app (FeathersJS and Grant for authentication), and the other is a Django app, using django-oauth-toolkit for authentication.

I am trying to get the NodeJS app to oauth with the python django app, so here is what I have done so far:

  1. Registered Feathers with Django Oauth toolkit -

enter image description here

  1. Configured Feathers/Grant with the following options:
        "key": "xxx",
        "authorize_url": "https://www.com/o/authorize",
        "access_url": "https://www.com/o/token"

But I'm running into an issue where the grant workflow is not receiving the access token, and am stuck at this point. Has anyone tried integrating two apps as such and been successful in this process? I'd appreciate any pointers, suggestions. Thanks!

simo
  • 15,078
  • 7
  • 45
  • 59
twoLeftFeet
  • 693
  • 1
  • 5
  • 25
  • Not entirely sure how that UI above is supposed to connect with Grant/Feathers, but essentially you need a Grant server up and running, and then in your Python/Django HTTP server you need a route that redirects to the `/connect` route of your Grant server. You can pass all options dynamically via querystring - [example](https://github.com/simov/grant/blob/master/examples/dynamic-proxy/express.js). What you see in that Express handler is what you need to have in your route in Django. You can test it with `grant.outofindex.com` if you want. – simo Sep 07 '20 at 17:09
  • Hi simo - grant is running as the auth middleware for feathers. So essentially I'm trying to get the flow like this. Feathers (client app) /authenticate -> Redirect to Django Oauth for approval/sign in -> Feathers redirect with access_code – twoLeftFeet Sep 08 '20 at 20:15
  • Ok, that should work. Only now I'm seeing that you are using the wrong grant type, it have to be set to `authorization code` instead. Grant will make the final request to exchange the `code` for an `access_token`, that's what the `access_url` configuration is for. – simo Sep 08 '20 at 20:50

0 Answers0