How can I verify a LinkedIn access token?
Asked Answered
P

4

10

How can I verify a LinkedIn access token?

I need to check if an access token is valid or not?

ex: in Facebook

https://graph.facebook.com/me?access_token=access_token

Is there a similar way to do it in LinkedIn?

Paphos answered 9/5, 2016 at 11:48 Comment(0)
P
11

I found that it can be done like this:

https://api.linkedin.com/v1/people/~?oauth2_access_token=YOUR-ACCESS-TOKEN

and that's it :).

Paphos answered 9/5, 2016 at 13:58 Comment(2)
It's not working to me, If you don't mind, could you tell me updated solution.Thermochemistry
Working for me, you can also check the company pages the token allows access to: api.linkedin.com/v1/…Howdy
D
3

Additionally, you can filter the values:

https://api.linkedin.com/v1/people/~:(id,first-name,last-name,headline,picture-url,location,industry,current-share,num-connections,summary,specialties,positions)?format=json&oauth2_access_token={0}
Dementia answered 18/5, 2018 at 15:59 Comment(0)
T
1

You can use Token Introspection to get some informations about the token

https://learn.microsoft.com/en-us/linkedin/shared/authentication/token-introspection?context=linkedin/context

Turkoman answered 25/6, 2020 at 14:38 Comment(1)
Hello! While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.Gonfalonier
L
1

The url has been changed and the v1 API does not work anymore. Do use this one, if you need to verify access tokens generated from Linkedin.

https://api.linkedin.com/v2/me?oauth2_access_token=<your-token-here>

For other social media's, use can use urls from this gist: https://gist.github.com/pavittarx/15b46b08e779c2113864e9db399f35ac

Luncheon answered 15/6, 2021 at 6:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.