如何在我的应用程序中取消授权/撤销LinkedIn令牌 [英] How to unauthorize/revoke LinkedIn token in my application

查看:106
本文介绍了如何在我的应用程序中取消授权/撤销LinkedIn令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个grails应用程序,我希望用户向我授予他/她的LinkedIn帐户访问权限,以获取信息并以不同的方式显示它.

I have a grails application in which I want a user to grant me access to his/her LinkedIn account to get information and show it in different ways.

我能够执行以下操作:

  1. 获取授权码
  2. 使用该授权码获取访问令牌
  3. 我将访问令牌和到期日期存储在我的用户实体中.
  4. 当到期日期在今天后的X天内刷新该访问令牌.

现在我遇到的问题是,我希望用户撤消该令牌或使该令牌无效,以便其他人可以使用同一台计算机和会话并登录到不同的LinkedIn帐户.

Now the issue I'm having is that I would like the user to revoke or invalidate that token so that someone else can use the same computer and session and login to a different LinkedIn account.

  • 这可能吗?
  • 如果没有?有没有办法删除LinkedIn Cookie?这样用户的LinkedIn会话就完成了,并且通过从LinkedIn中注销,他们将不得不再次授予对我的应用程序的访问权限.

供参考:

  • 我正在使用Grails 2.1.1
  • 不使用oauth进行身份验证,我只是使用Groovy的HTTPClient进行简单的GET和POST请求.
  • I'm using Grails 2.1.1
  • I'm NOT using oauth to do the authentication, I just use the HTTPClient from Groovy to do plain and simple GET and POST requests.

非常感谢!

推荐答案

最简单的方法是从存储中删除访问令牌.这样,您将不再有权访问该帐户.当领英使用OAuth 1.0a时,他们进行了一次Invalidate调用,这会使访问令牌无效.但是,当他们迁移到OAuth 2.0时,它就消失了.

The easiest thing to do is just to delete the Access Token from your storage. This way you no longer have access to that account. When LinkedIn was using OAuth 1.0a, they had an Invalidate call which would invalidate the Access Token. But when they moved to OAuth 2.0, that went away.

这篇关于如何在我的应用程序中取消授权/撤销LinkedIn令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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