Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
OAuth is an open standard for authorization, commonly used as a way for Internet users to authorise websites or applications to access their information on other websites but without giving them the passwords. These days OAuth is considered as the safest way to authorise and to get the user data from another resource server.
There are several famous servers around the world ( Like Facebook, Google, Linkedin, Twitter etc. ) on which most of the users are registered and these servers can be used to share the user data to other apps.
In this blog, We will talk about getting user data from Linkedin’s server using OAuth. There are several APIs provided by Linkedin to communicate with their server and request the user data as per the requirement.
For getting started you need to first register your app at here and get your Authentication Keys ( client_id and client_secret )
NOTE : DO NOT share your Client Secret value with anyone !!!
After getting your Authentication Keys, you need to make a GET request to the Linkedin API with your client_id to get an authentication code.
The request may look like :
https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=123456789&redirect_uri=https%3A%2F%2Fwww.example.com%2Fauth%2Flinkedin&state=987654321&scope=r_basicprofile
After making a successful authorization request, You will receive an authorization code and this authorization code is used to exchange access token form Linkedin server.
This time you need to make a POST request to get the access token.
https://www.linkedin.com/oauth/v2/accessToken?grant_type=authorization_code&code=AQRpE2V0kVBfBKpMmoyT72VDsfT_CV6N7uVYUNNnp_Jc39lISSrlNnVfrysMzG-fsoo_wb2zdAOFupz_HzkSvvLe1wz1XQMt-b33yf1nWaNDSNyVGKE&client_id=81fdcyfxm5621c&redirect_uri=http://magento.webkul.com/Mobikul/auth/linkedin&client_secret=****************
After making a successful AccessToken request, You will receive an access token and its expiry time. This access token is used in the next request to get the user data.
To retrieve basic information, Your request may look like :
https://api.linkedin.com/v1/people/~?format=json
To retrieve specific information, Your request may look like :
https://api.linkedin.com/v1/people/~:(id,num-connections,picture-url)&format=json
NOTE : format=json is to get the response in json format otherwise it will give the response in XML format.
After the above request you will receive the user data and can use it as per the requirement.
Thank you very much, This is Vedesh Kumar signing off … : )
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.
Hussein Zawia
Co-founder, 24Dokan
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.