如果用户通过oauth2授权对应用程序进行了授权,如何刷新Linkedin oauth令牌? [英] How to refresh Linkedin oauth token if the user authorized the app through oauth2 authorization?

查看:181
本文介绍了如果用户通过oauth2授权对应用程序进行了授权,如何刷新Linkedin oauth令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要刷新用户linkedin访问令牌,而不必重新进行初始授权过程.我还查看了此文档 http://developer. Lodge.com/documents/exchange-jsapi-tokens-rest-api-oauth-tokens ,但是它不起作用,因为我的用户通过常规OAuth对应用程序进行了授权,并且本文使用了JS OAuth. (不确定两个进程之间是否存在差异,以及从每个进程收到的访问令牌之间是否存在差异).即使我已经在同一浏览器上登录了另一个标签, 它总是提示我登录LinkedIn.

I need to refresh the user linkedin access token without them having to go through the initial authorization process all over again. I have also looked at this documentation http://developer.linkedin.com/documents/exchange-jsapi-tokens-rest-api-oauth-tokens, but It doesn't work because my users authorize the app through regular OAuth and the article uses the JS OAuth. (Not sure, if there is a difference between two processes, and if there is a difference between access tokens received from each process). Even though, I'm already logged in another tab on the same browser, it always prompts me to login to LinkedIn.

如果我尝试使用IN.User.isAuthorized(),尽管我已登录LinkedIn,但它似乎无法刷新令牌,但它返回false.

If I try IN.User.isAuthorized() it returns false though I'm logged in into LinkedIn and I can't seem to be able to refresh the token.

如果我将用户LinkedIn访问令牌从服务器传递到JS,并且用户LinkedIn ID IN.User.isAuthorized()始终返回true,即使我没有登录

If I pass the user LinkedIn access token from my server to the JS and the user LinkedIn id IN.User.isAuthorized() always returns true even when I'm not logged in

所以我想问的是,当用户在同一个浏览器上登录到linkedin时,是否有一种方法可以刷新用户linkedin oauth令牌thorguh JS,就像我们可以为facebook所做的那样?那是什么?

So what I'm trying to ask is, is there a way to refresh the user linkedin oauth token thorguh JS when the user is logged in to linkedin on the same broswer like we are able do for facebook ? and what is it ?

推荐答案

没有成员在您的应用程序中就无法刷新令牌.

You cannot refresh the token without the member being at your application.

如果要刷新令牌,则该成员需要在该令牌中,并且需要通过授权页面引导它们.如果他们登录了LinkedIn,这将是一个无缝的刷新,我们会将页面重定向到您的应用程序.

If you want to refresh the token, the member needs to be there and you need to direct them through the authorization page. If they're signed in to LinkedIn, this will be a seamless refresh and we'll redirect page to your application.

这篇关于如果用户通过oauth2授权对应用程序进行了授权,如何刷新Linkedin oauth令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆