Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
AFNetworking Extension for OAuth 1.0a Authentication
Objective-C C
Branch: master
Pull request Compare This branch is 153 commits behind AFNetworking:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Crypto
Twitter Example Client
TwitterMacExample
.gitignore
AFHTTPClient.h
AFHTTPClient.m
AFOAuth1Client.h
AFOAuth1Client.m
LICENSE
README.md

README.md

Extremely Experimental - Do Not Use In Production

This project is still under active development, but feel free to look around if you're curious. This will likely be merged with AFOAuth2Client once it is completed.

Instructions

Add all of the included files into an iOS project with AFNetworking. AFHTTPClient should replace the existing copy in your current AFNetworking installation.

Register your application to launch from a custom URL scheme, and use that with the path /success as your callback URL.

Here's how it all looks together:

AFOAuth1Client *twitterClient = [[[AFOAuth1Client alloc] initWithBaseURL:[NSURL URLWithString:@"https://twitter.com/oauth/"] key:@"..." secret:@"..."] autorelease];

// Your application will be sent to the background until the user authenticates, and then the app will be brought back using the callback URL
[twitterClient authorizeUsingOAuthWithRequestTokenPath:@"/request_token" userAuthorizationPath:@"/authorize" callbackURL:[NSURL URLWithString:@"x-com-YOUR-APP-SCHEME://success"] accessTokenPath:@"/access_token" success:^(AFOAuth1Token *accessToken) {
    NSLog(@"Success: %@", accessToken);
    NSLog(@"Your OAuth credentials are now set in the `Authorization` HTTP header");
} failure:^(NSError *error) {
    NSLog(@"Error: %@", error);
}];

Contact

Mattt Thompson

License

AFOAuth1Client is available under the MIT license. See the LICENSE file for more info.

Something went wrong with that request. Please try again.