1

I am working on a program which share data to LinkedIn User’s Profile. I am using Delphi XE2, OAuth and LinkedIn API for the same. I am able to Access token. But I am getting error on when trying to. I am using OAuth for Delphi. For SSL I am using, TIdSSLIOHandlerSOcketOpenSSL with method sslvSSLv3. I am trying to post the following:

I am posting (https://api.linkedin.com/v1/people/~/shares)as Url and ('; hiSiranyone) as Xml.

And my Idhttp Custom header*** ('oauth_consumer_key='+xxxxxxxxxxx+ ',oauth_signature_method="HMAC-SHA1"'+',oauth_timestamp='+QuotedStr(ARequest.GenerateTimeStamp)+ ',oauth_nonce='+QuotedStr(ARequest.GenerateNonce)+',oauth_version="1.0"'+ ',oauth_token='+xxxxxxxxxx+',oauth_signature='+QuotedStr(sign));

The result I am getting from Indy Http is this: Http/1.1 401 – Unauthorized Can anyone help me for fixing this? Please help....

vikas
  • 73
  • 10

1 Answers1

0

Look at this question and this article

IdSSLIOHandlerSocketOpenSSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
with IdSSLIOHandlerSocketOpenSSL do begin 
 SSLOptions.Method := sslvSSLv3;
 SSLOptions.SSLVersions := [sslvSSLv3]; 
 SSLOptions.Mode := sslmBoth; 
 SSLOptions.VerifyMode := []; 
 SSLOptions.VerifyDepth := 0; 
 host := ''; 
end;
Community
  • 1
  • 1
A1rPun
  • 16,287
  • 7
  • 57
  • 90
  • @vikas [Debugging LinkedIN](http://developer.linkedin.com/documents/debugging-api-calls) Please specify which headers you are sending. – A1rPun Jun 13 '12 at 10:30
  • 1
    Still facing same issue and my http.request.customheader is Add('Authorization: OAuth realm="https://api.linkedin.com/",oauth_consumer_key='+'"'+Consumer.Key+'"'+ ',oauth_token='+'"'+Token.Key+'"'+',oauth_signature_method="HMAC-SHA1"'+',oauth_signature='+'"'+sign+'"'+ ',oauth_timestamp='+'"'+ARequest.GenerateTimeStamp+'"'+',oauth_nonce='+'"'+ARequest.GenerateNonce+'"'+ ',oauth_version="1.0"'); please help me A1rPun – vikas Jun 13 '12 at 13:04
  • @vikas `'OAuth '+ 'oauth_nonce="'+@@@@@+'",'+ 'oauth_signature_method="'+@@@@@+'",'+ 'oauth_timestamp="'+@@@@@+'",'+ 'oauth_consumer_key="'+@@@@@+'",'+ 'oauth_token="'+@@@@@+'",'+ 'oauth_signature="'+@@@@@+'",'+ 'oauth_version="'+@@@@@+'",'` Make sure you replace `@@@@@` with your variables. – A1rPun Jun 15 '12 at 10:24
  • Still facing same issue @A1rPun Please help me. I am using ssl with these property SSLOptions.Method := sslvTLSv1; SSLOptions.SSLVersions := [sslvTLSv1]; SSLOptions.Mode := sslmBoth; SSLOptions.VerifyMode := []; SSLOptions.VerifyDepth := 0; host := 'https://api.linkedin.com'; And Xml Then Post http.post(Url,slist,Response); And My Header is Request.ContentType := 'application/xml'; – vikas Jun 18 '12 at 07:27
  • Ok, I cant figure out what you are doing wrong.. can you please update your question to make everything more readable? Please specify you version of indy components and please add more code, with partial code I/we cant do much for you. – A1rPun Jun 18 '12 at 08:54
  • hi @ A1rPun i have posted another ques with code . please check that and answer me. – vikas Jun 18 '12 at 10:04
  • @ A1rPun Please help me. Did you not got my updated question.And I am using Indy 10 with delphi Xe2 – vikas Jun 19 '12 at 07:54
  • [New question](http://stackoverflow.com/questions/11080570/share-data-to-linkedin-api-users-profile-for-status-update) please accept this one when its solved? – A1rPun Jun 19 '12 at 13:17
  • I have tried updated indy(10.5.8) from svn Revision(4771). Still facing same issue 401 Unauthorized. Please help me @A1rPun. I am trying alot of solutions. – vikas Jun 20 '12 at 13:47
  • Hi @A1rPun did you not get my Ques. Please tell me something.I am getting own status in XML but not doing post Please help me. If You have some time Then I want to chat with you.So Please contact me..... – vikas Jun 22 '12 at 13:03
  • Please Anyone help me. Till Now I am not posting xml with header. All time facing 401 error. My response is 401 1340895781480 BYE79V9AXB 0 [unauthorized]. OAU:2j71bnoc4x5f|3b2f15bd-a2c8-474f-ae05-541dd9b76468|*01|*01:1340895531:PxhePw0‌​/XHdvPz9cP3k/Px5WXz8= Please help me ........... – vikas Jun 28 '12 at 15:08