Skip to content

Instantly share code, notes, and snippets.

@ceeK
Created February 26, 2015 20:08
Show Gist options
  • Save ceeK/4c4a499cd6b97966d7ab to your computer and use it in GitHub Desktop.
Save ceeK/4c4a499cd6b97966d7ab to your computer and use it in GitHub Desktop.
[self authenticateUsingOAuthWithURLString:@"/oauth/token"
                                           username:@"engineering@getfitter.co"
                                           password:@"ZapY9mYZrpanZX3cyr8Dk3xjidtGWb"
                                              scope:@""
                                            success:^(AFOAuthCredential *credential) {
                                                NSLog(@"Token: %@", credential.accessToken);
                                                [AFOAuthCredential storeCredential:credential
                                                                    withIdentifier:FITTER_OAUTH_TOKEN];
                                                self.currentUser = nil;
                                                self.userLoggedIn = NO;
                                                self.anonLoggedIn = YES;
                                                completion(nil);
                                            }
                                            failure:^(NSError *error) {
                                                completion(error);
                                            }];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment