What's going on:
I have a backend server where I have the information of each individual user. Twitter and Facebook authentication is a common way of letting the user access one's application nowadays, so it was decided that he/she should be able use those platforms + the classic way (email + password)
The question:
After an user as logged in using Facebook and I receive a call back stating that it was successfully (for example with the SDK):
- (void)sessionStateChanged:(FBSession *)session
state:(FBSessionState) state
error:(NSError *)error
{
switch (state) {
case FBSessionStateOpen:
if (!error) {
// We have a valid session
NSLog(@"User session found");
}
break;
case FBSessionStateClosed:
case FBSessionStateClosedLoginFailed:
[FBSession.activeSession closeAndClearTokenInformation];
break;
default:
break;
}
How is it possible to pass now the credentials to the server, in order to access our own endpoints?
How can the backend know that this specific user that is making a request is in fact authenticated (or registered) in your backend?
What role does the app we create on facebook side (https://developers.facebook.com/apps/) has in this?
What is the Facebook API? The Facebook Graph API is an HTTP-based API that allows developers to extract data and functionality from the Facebook platform. Applications can use this API to programmatically query data, post in pages and groups, and manage ads, among other tasks.
The Graph API is the primary way to get data into and out of the Facebook platform. It's an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.
FBSession.activeSession.accessToken
-[FBRequestConnection startForMeWithCompletionHandler:]
. This will return a FBGraphUser
instance which contains email/name among other details.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With