-
Notifications
You must be signed in to change notification settings - Fork 66
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
How do i get user id and email from the access token ? #15
Comments
Hey @Dharin-shah, Simplicity is useful for obtaining an access token when you're using it for authentication with a backend server of your own. In that case, you'd implement the Facebook API / Google API / etc in your backend. If you'd like to make frontend calls to the Facebook / Google APIs, I'd recommend still using the Facebook / Google SDKs, as this is specifically for login. Here's docs on how to build it into your backend: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow#checktoken |
Hey @edjiang thanks. I just wanted this lightweight library to do such stuff. Facebook and Google SDK weighs a lot leaving huge redundancy. Just for reference, I think directly calling the facebook api using the access token does the trick |
Yeah, I think you're right -- changed my mind on this a bit. Maybe we should be adding this into Simplicity. If you're interested in contributing, I'm probably not going to work on this in the near future -- although I think we should wait until Swift 3 drops and stabilizes to continue work =] |
Sure. Thanks. |
Hello Dharin-shah, through the access token you can get name and id fields, but I haven't been able to get the email, have you been able to? |
@Marini83 oh! I must have misunderstood your request. Yeah, you need to specifically request the scopes from Facebook. Check out the docs here: https://github.com/SimplicityMobile/Simplicity#requesting-scopes-for-oauth-providers |
I stand corrected! I can't believe I didn't think of giving scope first, I thought it was all-inclusive. Thank you @edjiang ! So Dharin-shah could use the scope too correct? |
@Dharin-shah's answer was pretty good, but if you want to get the user's Facebook email as well, you need to add an
|
+1 for this feature in Simplicity. |
I've done it here: https://github.com/diegotrevisan/Simplicity.git |
Why dont you raise a pull request over here, sorry guys, was away for a while, got into a whole other project. |
No description provided.
The text was updated successfully, but these errors were encountered: