Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook iOS SDK 3.0 Re-Authorisation
    primarykey
    data
    text
    <p>I have a few of questions about the new FBSession reauthorisation (reauthorizeWithPermissions: behavior: completionHandler:) in facebook sdk 3.0:</p> <p>Once someone has logged in via facebook on my app, on certain pages I would like to re-authenticate the user with his/her facebook credentials. This is to ensure that the person who is viewing the page and the person who initialled logged, are the same. The permissions for re-auth remain the same as login. All i need is a re-confirmation of the user's password to ensure this case. </p> <p>Hence I am using the reauthorisationWithPermissions: to do this. And I am setting the behaviour as FBSessionLoginBehaviorForcingWebView to ensure that the user is forced to enter his/her credentials. However, this does not work at all. It simply pops up a blank webview for a couple of seconds and then disappears... At this point, it calls the FBSesstionStateHandler block with the state set to FBSessionStateOpen, however, fails to call the FBSessionReauthorizeResultHandler defined within the (completionHandler:). </p> <p>However, if I simply set the behaviour to default (FBSessionLoginBehaviorWithFallbackToWebView) it works fine by passing the request back and forth between facebook app/safari and completes the call by calling the completionHandler correctly. However, with the default behaviour it does not force the user to re-enter his/her password.</p> <p>So I am really confused, and the sdk docs on the web are not very useful for my case. Could someone please advise me on what I am doing wrong... or weather its a known bug in the SDK ? If so, how can I go about meeting my requirements ?</p> <pre><code>-(void) reauthThroughFacebook { if ( !self.facebookSession.isOpen &amp;&amp; self.facebookSession.state == FBSessionStateCreatedTokenLoaded) { [self.facebookSession openWithBehavior: FBSessionLoginBehaviorWithNoFallbackToWebView completionHandler: self.stateHandler]; } if ( self.facebookSession.isOpen ) { [self.facebookSession reauthorizeWithPermissions: self.userPermissions behavior: FBSessionLoginBehaviorForcingWebView completionHandler:^(FBSession *session, NSError* error){ if (self.facebookSession == session) { [self completedReauthWithSuccess:(error == nil) error:error]; } }]; } else { [self completedReauthWithSuccess:NO error:[NSError errorWithDomain: @"No active session found." code: FBErrorInvalid userInfo: nil]]; } } </code></pre> <p>Also, once the reauth web view pops up correctly, how do I ensure that the user's email address is auto populated and block the user form changing it ? Can I access the web view within the facebook sdk to set these properties?</p> <p>Finally, what happens to the access token and expiry date if the re-auth takes place with the same permissions as login ??</p> <p>Thank you in advance,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload