forked from facebook/facebook-ios-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the extendAccessToken method to facebook-ios-sdk
Summary: Whenever user makes an API call the SDK checks if the access token is about to expire. If that's the case SDK will try to silently refresh the token. Developer can also force the refreshing process by calling [facebook extendAccessToken] method (this might be useful for apps that doesn't make frequent API calls). Also provided an example of this functionality in the Hackbook. Test Plan: With prod: tried refreshing the token and check if the expirationDate is correct. With sandbox: - disabling checking the ssl certificates in the sdk (done by following lines (src/FBRequest.m) - I'm sure there's an easier way, but I don't know it :P): LANG=C - (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace { return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]; } - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge]; [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge]; } - changing the rest server url (in my case:) LANG=C static NSString* kRestserverBaseURL = @"https://api.kamil.devrs332.facebook.com/method/"; - after that I switched to app which access expires after 10 minutes and tested if the refreshing process behaves correctly (had to modify isSessionOld function) Reviewers: yariv, jimbru, brent, ekoneil Reviewed By: yariv CC: lshepard, ekoneil, jgabbard, brent, yariv, kamil, trvish Differential Revision: https://phabricator.fb.com/D371702 Task ID: 823099
- Loading branch information
Kamil Kraszewski
authored and
Kamil Kraszewski
committed
Dec 22, 2011
1 parent
6e15f95
commit 4969a99
Showing
5 changed files
with
183 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.