hybridauth/hybridauth — pull request #165 by willerz-dotank (2014-03-19 15:08:09+00:00)
Title: iOS reverse-auth support for Facebook

iOS apps which need to authenticate the user to an API server using Facebook credentials can now be produced.

The sequence in the client app is to start the hybridauth Facebook flow

…/hauth?hauth.start=Facebook&hauth.time=

which asks to redirect to a page on Facebook's site:

https://www.facebook.com/dialog/oauth?…

the app does not follow this redirect, and instead completes the hybridauth Facebook flow using Apple's SLRequest class to create an appropriate URL request that delivers the access token to the server:

SLRequest *socialRequest =
[SLRequest requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodGET
URL:[NSURL URLWithString:@"…/hauth"]
parameters:@{@"hauth.done":@"Facebook" }];
socialRequest.account = the_fb_account;
NSURLRequest *request = socialRequest.preparedURLRequest;

The app must create, start, and complete a URL connection to this URL request. It will then have a facebook-authenticated session to the server.