ACAccountStoreを使用して認証できます。以下のコードのほとんどについて、http://blogs.captechconsulting.com/blog/eric-stroh/ios-6-tutorial-integrating-facebook-your-applicationsに感謝します。
self.accountStore = [[ACAccountStore alloc]init];
ACAccountType *FBaccountType= [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSString *key = @"987654"; //put your own key from FB here
NSDictionary *dictFB = //use the ACAccountStore ACFacebookPermissionsKey to help create your dictionary of permsission you'd like to request, such as the users email, writing on the wall, etc.
[self.accountStore requestAccessToAccountsWithType:FBaccountType options:dictFB completion: ^(BOOL granted, NSError *e) {
if (granted) {
NSArray *accounts = [self.accountStore accountsWithAccountType:FBaccountType];
//it will always be the last object with SSO
self.facebookAccount = [accounts lastObject];
} else {
//Fail gracefully...
NSLog(@"error getting permission %@",e);
}
}];
その時点で、アカウントストアのoauthトークンにアクセスできます。このトークンをサーバーに送信して、Facebookとのサーバー側のやり取りを行うことができます。