How to unauthorize/revoke LinkedIn token in my application

旧城冷巷雨未停 提交于 2020-01-05 03:33:16

问题


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.

I was able to do the following:

  1. Get the authorization code
  2. Use that authorization code to get the Access Token
  3. I store that Access Token together with the expiration date in my User entity.
  4. Refresh that Access Token when the expiration date is within X days from today.

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.

  • Is this possible?
  • If not? Is there a way to delete the LinkedIn cookies? so that the user's LinkedIn session is finished and by being logged out from LinkedIn then they will have to grant access to my application again.

For reference:

  • 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.

Thanks a lot in advance!


回答1:


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.



来源:https://stackoverflow.com/questions/15766464/how-to-unauthorize-revoke-linkedin-token-in-my-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!