-
Notifications
You must be signed in to change notification settings - Fork 311
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
Minimal example for SPA implementation of social login #147
Comments
After struggling to use social logins with my SPA for days, I finally figured out how the flow is supposed to work. Unfortunately I don't have example code, but I can explain what I did to setup Google OAuth2
SPA page => Google Sign in page => SPA callback page ( The setup for other providers might be a little different, but that's the gist of things. |
I agree this would be very helpful. I'm not sure I have the bandwidth to add this, but PRs are welcome! |
I'm hitting #158 and downgrading EDIT: it's something wrong with my versions of libraries and Pipenv. |
First of all many thanks for the great work! I am dedicated to use this package for project I'm working on. However, I have spent a few days now trying to understand the code of allauth and this package in order to build a simple social auth REST API for a SPA app (Angular) and I just fail to understand how a social login (with Google or Azure) works using the
SocialLoginView
(in/allauth/account/views.py
). This view seems to expose a POST endpoint expecting anaccess_token
and/orcode
in its body. But how do I get those in the first place? I would appreciate if someone could post / point me to a minimal example that covers the complete flow from hitting a "Login with Google" button in an SPA app (e.g. Angular, React, Vue or whatever) to receiving the data (e.g. JWT token) necessary to make requests to secured endpoints. I think the docs would greatly benefit from that too. Thanks again!The text was updated successfully, but these errors were encountered: