Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linkedin使用node.JS为OAuth2访问令牌交换JS API令牌?_Node.js_Linkedin Jsapi - Fatal编程技术网

Linkedin使用node.JS为OAuth2访问令牌交换JS API令牌?

Linkedin使用node.JS为OAuth2访问令牌交换JS API令牌?,node.js,linkedin-jsapi,Node.js,Linkedin Jsapi,我需要linkedin永久令牌获取的帮助。我正在使用node.js。 我能够成功地对用户进行身份验证,将安全cookie传递到我的后端。 如何将JSAPI令牌交换为OAuth1.0a访问令牌。 tmpAcesstoken='xxxxxxxxxxxxx'。还验证了签名。 我试过下面的方法 oa = new OAuth( "https://api.linkedin.com/uas/oauth/requestToken", "https://api.l

我需要linkedin永久令牌获取的帮助。我正在使用node.js。 我能够成功地对用户进行身份验证,将安全cookie传递到我的后端。 如何将JSAPI令牌交换为OAuth1.0a访问令牌。 tmpAcesstoken='xxxxxxxxxxxxx'。还验证了签名。 我试过下面的方法

         oa = new OAuth( "https://api.linkedin.com/uas/oauth/requestToken",
                "https://api.linkedin.com/uas/oauth/accessToken",
                "xxxxx", "xxxxxxxx", "1.0A", 
                "http://localhost:1337/", "HMAC-SHA1");


         oa.get("http://api.linkedin.com/v1/people/~?oauth_oauth2_access_token="+tmpToken, function(error, data) {
                  if (error) {
                     console.log("error");
                      console.log(error);
                       } else {
                       console.log("success");
                        console.log(data);
                         }
                    });
此令牌的有效期仅为60天。如果用户60天未访问,我们如何刷新令牌

请任何人帮助我

谢谢。

这里是如何将JS令牌交换到oauth 1.0a令牌的参考

我想如果不与用户交互,就无法刷新令牌