-
Notifications
You must be signed in to change notification settings - Fork 87
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
Facebook authentication #98
Comments
Hmm, basically this should work if you set the callback url from facebook to use backend url, and then in there create user + JWT. Although I might be wrong with this, I hope that you make PR when you got this working. |
Any progress on Facebook integration? I'd like to give a hand if possible |
Im currently busy on some other stuff, so it is on hold for me right now. torsdag 15 oktober 2015 skrev markmssd [email protected]:
|
Almost got it working, but ran into CORS problems... Looks like since the frontend and backend are on different domains, the Facebook callback gets rejected for some reason. |
Have you whitelisted both domains in the Facebook-app settings? torsdag 15 oktober 2015 skrev markmssd [email protected]:
|
I just tried that, setting it to 127.0.0.1 (I'm working locally), but the same problem persists... Noteworthy: Only getting this problem when accessing from the frontend (http://localhost:3001/auth/facebook) "#=" is a string the Facebook appends to it, as per their doc, so the response is indeed returned from Facebook. However, I then get a "Invalid User" since that user does not exist yet. |
This is how we implemented the providers authentification for Strapi : https://github.com/wistityhq/strapi-generate-users/blob/master/files/api/user/controllers/Auth.js |
Have you made any progress? I'm facing the same issue. Any help would be greatly appreciated. |
So to make facebook auth to work with an Sails backend is pretty straightforward. First. Forget about facebook auth on the backend. Allt authentication will be handled on the front. So the flow goes like this-> Voila, logged in. Just remember, if you log out of facebook, you will still be logged in the frontend. Just must implement some kind of reauthorisation procedure with the backend and with facebook, and dont use to long lived tokens. |
So this is what i use in the controller for checking facebook token and issuing JWT on the backend.
|
I can see that facebook integration is a todo item, so i decided to give you a hand and start building on a Facebook authentication.
So
The separation between front and backend makes the Passport strategy pretty worthless because it cant access the session on the front end.
So the front end must do the heavy lifting (maybe use an existing angular-module) and authenticate with facebook, then it must pass some form of data to Sails so sails can connect the model with the Facebook user.
Or am i missing something?
The text was updated successfully, but these errors were encountered: