I am working on a Unity App. For login, there are two methods, one using Email and another using Facebook. In case of login separately, I do not have any problem. Registration and Login with Email works perfectly. And Login with Facebook works perfectly as well. Here's the workflow, I created just to make you clear.
There's another schema for account
, which is used for login.
var Account = new Schema({
email: String,
password: String
});
Things to know about the backend API.
- Passport is used for Authentication
- Successful login returns email and token to the client through API.
- On client, token is most to play game and use the overall features.
As I said, I have already covered the part when if a client registers and login using email, then client can use the app. But my confusion is handling the logins with Facebook. Facebook SDK is already integrated with the Unity App, and Login is success.
Now, how can I use the Facebook login information that is generated by the Facebook SDK onto my back end, so that I can authorize the user throughout the system, as done in email login.
Going through other questions in SO and Google, I came across passport-facebook-token
, I also tried using the plugin but could not came up with the logic and flow for handling the data from SDK into the Nodejs API. Can someone help understand how it is done?
via Luzan Baral
No comments:
Post a Comment