Closed arol closed 7 years ago
Hi arol, I'd suggest you take a look at django-rest-framework-social-oauth2 which integrates this library together with django-oauth-toolkit into DRF.
In SPA you probably want to have your own authentication provider built in your backend which is able to generate tokens for your users (based on either good-old username/password credentials or) as an exchange for Linkedin token. Your frontend (JS) shall then be responsible for obtaining an access_token from Linkedin first, and then subsequently using the convert_token
method to retrieve your App's token from your backend. Since your frontend will use the new token for all subsequent requests against your backend API, you'll also avoid hitting Linkedin API with every request.
The only way I see this possible right is by doing:
complete
view that mimics the code from the original (it's hard to reuse it at the moment), and returns the redirect with the needed token for the userI'm closing this, please reopen in social-app-django if still relevant.
Hi everyone.
I'm developing an app that it's composed by a standalone api (with django rest framework) and a single page application consuming that api. I've added PSA into my backend to add a sign in with linked in.
The strategy goes like this:
The problem is that I don't see any step in which I can do the 3rd step in the PSA workflow.
Another solution could be to set the provider redirections to the front-end so it can proxy that requests to the server, using the front-end as a middleware. The problem with this one is that I didn't see where to set the provider redirection urls in the PSA configuration.
PSA is a very nice library, and could be awesome to have a description of the usage with a single page application in the documentation. I can help with this.