Open Dharin-shah opened 7 years ago
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
https://graph.facebook.com/me?access_token=
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 fields=name,email
to the url:
https://graph.facebook.com/me?fields=email,name&access_token=[YourAccessToken]
+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.
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 https://developers.google.com/identity/protocols/OAuth2UserAgent#validatetoken