From d37bba3272b3c9714811c1eab4dc08ba3db6fc40 Mon Sep 17 00:00:00 2001 From: Tyler Hunt Date: Tue, 18 Mar 2014 11:18:35 -0400 Subject: [PATCH] Updated example usage. --- README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 072bb91f..a51d06ea 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,18 @@ AFOAuth2Client is an extension for [AFNetworking](http://github.com/AFNetworking NSURL *url = [NSURL URLWithString:@"http://example.com/"]; AFOAuth2Client *oauthClient = [AFOAuth2Client clientWithBaseURL:url clientID:kClientID secret:kClientSecret]; -[oauthClient authenticateUsingOAuthWithPath:@"/oauth/token" - username:@"username" - password:@"password" - scope:@"email" - success:^(AFOAuthCredential *credential) { - NSLog(@"I have a token! %@", credential.accessToken); - [AFOAuthCredential storeCredential:credential withIdentifier:oauthClient.serviceProviderIdentifier]; - } - failure:^(NSError *error) { - NSLog(@"Error: %@", error); - }]; +[oauthClient authenticateUsingOAuthWithURLString:@"/oauth/token" + username:@"username" + password:@"password" + scope:@"email" + success:^(AFOAuthCredential *credential) { + NSLog(@"I have a token! %@", credential.accessToken); + [AFOAuthCredential storeCredential:credential + withIdentifier:oauthClient.serviceProviderIdentifier]; + } + failure:^(NSError *error) { + NSLog(@"Error: %@", error); + }]; ``` ## Contact