You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, all
I have a view controller trying to login linkedin and post. But I couldn't get login, have the error message "Authorization failed Error Domain=WebKitErrorDomain Code=101 "(null). Really frustrated, hoping someone could help me! Thanks.
Hi, all
I have a view controller trying to login linkedin and post. But I couldn't get login, have the error message "Authorization failed Error Domain=WebKitErrorDomain Code=101 "(null). Really frustrated, hoping someone could help me! Thanks.
Here is my code
ViewController.h
import <UIKit/UIKit.h>
import "LIALinkedInApplication.h"
import "LIALinkedInHttpClient.h"
@interface ViewController : UIViewController
@Property (nonatomic, strong) LIALinkedInHttpClient *client;
@EnD
ViewController.m
import "ViewController.h"
@interface ViewController ()
@EnD
@implementation ViewController
(void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
LIALinkedInApplication *application = [LIALinkedInApplication applicationWithRedirectURL:@"http://www.google.com" clientId:@"" clientSecret:@"" state:@"something" grantedAccess:@[@"r_fullprofile", @"rw_nus", @"w_share"]];
self.client = [LIALinkedInHttpClient clientForApplication:application presentingViewController:nil];
}
[self.client getAuthorizationCode:^(NSString *code) {
[self.client getAccessToken:code success:^(NSDictionary *accessTokenData) {
NSString *accessToken = [accessTokenData objectForKey:@"access_token"];
[self requestMeWithToken:accessToken];
} failure:^(NSError *error) {
NSLog(@"Quering accessToken failed %@", error);
}];
} cancel:^{
NSLog(@"Authorization was cancelled by user");
} failure:^(NSError *error) {
NSLog(@"Authorization failed %@", error);
}];
}
[self.client GET:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~?oauth2_access_token=%@&format=json", accessToken] parameters:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *result) {
NSLog(@"current user %@", result);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"failed to fetch current user %@", error);
}];
}
The text was updated successfully, but these errors were encountered: