Skip to content

mehtaamish89/LinkedIn-JavaScript-API-Integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkedIn-JavaScript-API-Integration

Integrating JavaScript API Using Angular JS.

For Demo Click Here

Steps to integrate Sing-in with linked-In

  1. You need to create a application with Linkedin which will have the permission to access the data available of the logged in users profile.
    Click here to create a new Linkedin Application
  2. To use the login feature in your application you need to add the LinkedIn javascript libray on your web page. This library can be download from here.
    It can also be directly referenced as follows:
        <script type="text/javascript" src="//platform.linkedin.com/in.js"><br>
            api_key: YOUR_API_KEY_HERE //Application key from your application
            authorize: true            //check if user is already logged in and a cookie is present
            onLoad: onLinkedInLoad     //Javascript function to be executed after login.
        </script>
    
  3. Use the following tag to display the signin with LinkedIn button on the web page.
      <script type="in/Login"></script>
    
  4. Define following functions to handle Singin event on the web page.
     <script type="text/javascript">
    
          // Setup an event listener to make an API call once auth is complete
          function onLinkedInLoad() {
              IN.Event.on(IN, "auth", getProfileData);
          }
    
          // Handle the successful return from the API call
          function onSuccess(data) {
              console.log(data);
          }
    
          // Handle an error response from the API call
          function onError(error) {
              console.log(error);
          }
    
          // Use the API call wrapper to request the member's basic profile data
          function getProfileData() {
              IN.API.Raw("/people/~").result(onSuccess).error(onError);
          }
    
      </script>
    

For further reference Click here

About

Integrating JavaScript API Using Angular JS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published