English 中文(简体)
使用 jsoauuth 库获取错误时链接到 Access_token 请求
原标题:LinkedIn Access_token request getting error using jsoauth library

hi i am try to integrate LinkedIn with my mobile application which is developing in phonegap with Xcode. Now i have get the authorization using javascript library from github(https://github.com/bytespider/jsOAuth/blob/daa8823a02fa570b285ac26f66ff6c5d8be9d4ec/src/OAuth/Consumer.js) jsoauth but i do not know how to set header for "https://api.linkedin.com/uas/oauth/accessToken" any one please give example for it.Now i got oauth_token,verifier,oath_token_secret.how can i use it? i get the problem send like

代码是 :

var 选项_________________________________________________________________________________________________________________________________________________

    consumerKey: XXXXXXXXXX ,

    consumerSecret: XXXXXXXX ,

    verifier: verifier,    

    signatureMethod: HMAC-SHA1 

   };

    oauth = OAuth(options);

    oauth.post( https://api.linkedin.com/uas/oauth/accessToken , null,

               function(data) {alert( acess );   

               window.plugins.childBrowser.close(); 

               },
              function(data) {
              alert( no access );
              console.log(data.error);

               }

              );

在此调用错误函数, Xcode 错误显示为 :

WebKit 在 WebView: decide Policy for Navigation Action: request: frame: decision Listener: delegate: respresent: {%/strong> - [JKarray objectAtIndex:]: 索引(1) 超越界限(1)

谁能帮我 如何得到LinkeIn的 AccessToken。

问题回答

我不认为你能把核查器设定为一种选择。

尝试使用函数

oauth.setVerifier( verifier )

& amp;

oauth.setAccessToken( MY-ACCESS-KEY ,  MY-ACCESS-SECRET );

http://bytespider.github.io/jsOAuth/api-reference/

在那之后,JsOAuth会为您设置信头。

我还只是拿起使用这个图书馆的存取信号时遇到一个问题, 结果发现它不必要地包括回调参数, 导致请求失败 。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签