雅虎 OAuth 实现无法离线工作

发布于 2024-08-26 17:50:44 字数 387 浏览 4 评论 0原文

我需要将 Delicious 书签下载到非 Web 应用程序,而无需持续的用户交互。我正在使用 Delicious 的 V2 API(使用 oAuth),但问题是它们的访问令牌似乎在一小时后过期。

我将用户重定向到雅虎进行一次性授权没有任何问题,但此处描述的内容(http://developer.yahoo.com/oauth/guide/oauth-refreshaccesstoken.html) 意味着我必须在用户访问令牌过期之前一直刷新我的访问令牌离开。

这真的是他们完成 oAuth 实施的方式吗?

I need to download my Delicious bookmarks to a non-web application without constant user interaction. I'm using Delicious's V2 API (using oAuth) but the problem is it seems their access tokens expire after one hour.

I don't have any issues with redirecting the user to Yahoo for a one time authorization, but what is described here (http://developer.yahoo.com/oauth/guide/oauth-refreshaccesstoken.html) means I would have to refresh my access tokens all the time before they expire when the user is away.

Is this really the way they've done their oAuth implementation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

困倦 2024-09-02 17:50:44

您只需在他们再次使用应用程序时刷新访问令牌,而不是在他们离开时刷新访问令牌。您可以传递之前过期的令牌并获得新的令牌作为回报。

You only need to refresh the access token when they come to use the application again, not while they're away. You can pass the previously expired token and get a new one in return.

仙气飘飘 2024-09-02 17:50:44

这是一个问题吗?您只需要在访问令牌过期时进行额外的服务器端调用来刷新它(只要授权本身尚未过期,授权本身应该持续更长时间,并且在过期时需要用户交互)。

Is that a problem? You should only need to make an additional server-side call to refresh the access token if it expires (as long as the authorization itself has not expired, which should last longer, and would need user interaction when it expired).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文