问题
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:
- Get the authorization code
- Use that authorization code to get the Access Token
- I store that Access Token together with the expiration date in my User entity.
- 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