Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

AFOAuth1Client for LinkedIn

branch: master
README.md

AFLinkedInOAuth1Client

An AFOAuth1Client subclass for easily authenticating with LinkedIn.

Instructions

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:

AFLinkedInOAuth1Client *linkedinClient = [[AFLinkedInOAuth1Client alloc] initWithBaseURL:[NSURL URLWithString:@"https://api.linkedin.com/"]
                                                                     key:@"KEY"
                                                                  secret:@"SECRET"];

[linkedinClient authorizeUsingOAuthWithRequestTokenPath:@"uas/oauth/requestToken"
                                  userAuthorizationPath:@"uas/oauth/authorize"
                                            callbackURL:[NSURL URLWithString:@"x-yourscheme://success"]
                                        accessTokenPath:@"uas/oauth/accessToken"
                                           accessMethod:@"POST"
                                                success:^(AFOAuth1Token *accessToken) {
                                                    NSLog(@"Success: %@", accessToken);
                                                } failure:^(NSError *error) {
                                                    NSLog(@"Error: %@", error);
                                                }];

Details for LinkedIn

Two problems occur from the base AFOAuth1Client implementation, onlined on this page.

  • Content-Type needs to be text/xml. Don't think thats in the OAuth spec...
  • "Properly handling oauth_token_secret"

Contact

PJ Gray

License

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

Something went wrong with that request. Please try again.