Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for SPAs #8

Open
Andrew-Chen-Wang opened this issue Jul 12, 2021 · 7 comments
Open

Adding support for SPAs #8

Andrew-Chen-Wang opened this issue Jul 12, 2021 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@Andrew-Chen-Wang
Copy link
Owner

No description provided.

@Andrew-Chen-Wang
Copy link
Owner Author

@azataiot I'll mull it over the week. Not sure what your ETA for this work is. What I'm thinking in your use case is that we need to reroute all the redirect urls properly. The provider tutorial SHOULD actually be enough, we just need to add some more custom configuration.

I'd totally be willing to work on this, but it's not high on my priority list since I don't primarily use SPAs. If you'd like to start a PR or have any questions, I'm happy to consult and answer all questions as this is pretty important to people.

Number one rule: don't use grant type password. If you're planning on making a PR, first create a test repository and we'll work there. Then we can start merging and setting up a PR for this repository.

@Andrew-Chen-Wang
Copy link
Owner Author

Andrew-Chen-Wang commented Jul 12, 2021

The redirect urls after login on the provider side is just you doing window.location.url = "redirect url" where the redirect url is what the server sends. That redirect url is just the DOT views that say "You authorize PROJECt to read your email and name". So same provider base domain. Then when client presses authorize, that should redirect back to your SPA. That redirect back to your SPA should include the access tokens. All you need to do is hit the SimpleJWT endpoints on the consumer website.

I'm actually more inclined to do this now since it's pretty interesting. For the sake of my time as well, please provide a repository that includes a provider with React/Vue.js that uses SimpleJWT for authentication. I don't need a template for the consumer, just one for the provider :) @azataiot That'd be greatly appreciated! Just trying to manage my time properly for side projects :D

It should also include a register and login process.

@azataiot
Copy link

This is a nice start here!

As you said,
I will set up a repository and start working on it.

Currently, the problem I have is that I should start or clone a new sample frontend that is much more Universal, rather than too much connected to my company logic.

As for my time, I will able to do all the above after I finishing the current site, or on the weekends.

@Andrew-Chen-Wang
Copy link
Owner Author

Andrew-Chen-Wang commented Jul 12, 2021

Just a simple form, nothing special, not much css, just basic input tags is good enough. There's no need to do the OAuth integration, just a basic SimpleJWT setup. Does that sound similar to your company logic? I'm also only going to be able to work on this on the weekend. But thanks a ton for setting it up!

@azataiot
Copy link

azataiot commented Jul 12, 2021 via email

@Andrew-Chen-Wang
Copy link
Owner Author

@azataiot generally though, your login system is basically filling out a form on the frontend then sending that info by hitting the SimpleJWT endpoints to get the access and refresh token right?

@azataiot
Copy link

@azataiot generally though, your login system is basically filling out a form on the frontend then sending that info by hitting the SimpleJWT endpoints to get the access and refresh token right?

To my regret, it is not that simple. There are several systems sitting between them for security reasons .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants