Closed chiefy closed 12 years ago
Hello Christopher!
I'm currently traveling abroad and I don't have access to my computer. As soon as I come back I'll look into this issue and fix whichever bug is preventing the engine to work with Linkedin. Sorry for the delay.
No worries, thanks again for looking into it!
I have ran into the same problem. Have you found a solution yet?
For what it is worth, this example (other library) does work with LinkedIn: http://www.whitneyland.com/2011/03/iphone-oauth.html
I have found the solution after a few hours of searching!
LinkedIn doesn't like it when your urlEncode the ~ sign. And that is what the - (NSString*) urlEncodedString
method in NSString+MKNetworkKitAdditions.h
does.
So for me the quick fix was to remove the ~ by changing: (line 55)
CFStringRef encodedCFString = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(__bridge CFStringRef) self,
nil,
CFSTR("?!@#$^&%*+,:;='\"`<>()[]{}/\\|~ "),
kCFStringEncodingUTF8);
to:
CFStringRef encodedCFString = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(__bridge CFStringRef) self,
nil,
CFSTR("?!@#$^&%*+,:;='\"`<>()[]{}/\\| "),
kCFStringEncodingUTF8);
Thanks - I will have to plug that in and try it out to make sure it doesn't break Twitter oAuth (though I don't imagine it would)
@ericmulder thanks for that tip - I implemented it in my code and RSOAuth now works with LinkedIn - though I had some other issues I had to deal with in MKNetworkKit to get the REST POSTing XML properly.
I fixed this in my fork of MKNetworkKit and updated RSOAuthEngine to point to the latest revision, so you shouldn't need manual fixes anymore. Thanks for finding (and fixing) the bug!
I also issued a pull request to MKNetworkKit with the fix.
Thanks a lot for your work @rsieiro !
I am trying to hook this up to use with LinkedIn's REST API, and I am having some issues. I am getting a 401 - unauthorized for my requests to their API after succesfully going through the oAuth authentication. I was trying to figure out what was up and I found their oAuth tool thingee:
https://developer.linkedin.com/oauth-test-console
It lets you input your oAuth header information and it generates what it deems a "valid" HTTP Authentication Header. I compared the data that RSOAuth generates vs. this tool and noted that the oauth_signature param was the only difference. According to LinkedIn:
So basically LinkedIn is saying that your signature code is all wrong :)
I am not so sure.
Anyhow, thanks for your work on this. I was hoping that I could hook this up so I could use Twitter / LinkedIn and Facebook API calls all with the same library thus reducing app size.
Also I should note that this worked fine for me with Twitter.