With more than 300 million members worldwide, LinkedIn is the largest and most trusted source of professional identity. Leverage this power to enhance the sign-in experience on your sites and apps.

Use Sign in with LinkedIn to:

  • Reduce friction and get more sign-ups by allowing users to sign in with LinkedIn instead of creating a new account
  • Minimize the cost and time associated with implementing your own login, profile management, password change and recovery workflows
  • Personalize your sites and apps with up-to-date member profile data

 

How will you integrate Sign In with LinkedIn?

  • Before you get started …

    Please make sure to read the Getting Started with the REST API guide.  It contains important information to successfully incorporate signing in with LinkedIn within your application.

    Step 1 - Authenticate the user

    The bulk of the work required to Sign In with LinkedIn is completed when you authenticate the current user.  If you do not have a previously stored access token the for the current user, follow the steps outlined in the Authenticating with OAuth 2.0 Guide to acquire a new access token that can be used in the next step of the Sign In process.

    If required, you can download official LinkedIn button images to you in your project from the Image Resources section.

    See Permissions and Limits to ensure that your application is requesting the correct member permissions for this API call during the OAuth 2.0 authentication process.

    Step 2 - Retrieve basic profile data

    Once you have obtained a valid access token for the user, you can use the following REST API call to retrieve basic profile data for the user:

    GET
    https://api.linkedin.com/v1/people/~?format=json
    Sample API response
    {
      "firstName": "Frodo",
      "headline": "2nd Generation Adventurer",
      "id": "1R2RtA",
      "lastName": "Baggins",
      "siteStandardProfileRequest": {
        "url": "https://www.linkedin.com/profile/view?id=…"
      }
    }

    With this basic profile information in hand, the sign in process can be considered complete and its time for your application to continue the user experience.

    Requesting additional profile fields

    LinkedIn does not return all possible member profile fields that are available to you by default.  There is a limited selection of additional member fields that are also available to you which may be relevant to your application.  Refer to the Basic Profile Fields page for a complete list of the basic member profile fields. 

    The following example demonstrates how to customize your API call to request specific member profile fields that you wish to be returned during the Sign In with LinkedIn workflow:

    GET
    https://api.linkedin.com/v1/people/~:(id,num-connections,picture-url)?format=json
    sample api response
    {
      "id": "1R2RtA",
      "numConnections": 42,
      "pictureUrl": "https://media.licdn.com/mpr/mprx/…"
    }

    Requesting alternate profile languages

    LinkedIn members have the opportunity to provide their profile information in multiple languages. To specify the language you would prefer to have returned, you include an Accept-Language HTTP header with your call.  The value of the header should be a comma separated list of Language Codes, ordered from highest to lowest priority of preference.

    Be aware that these are not localized or automatically translated values.  The only non-English information available is information that was manually entered by the member.

    Sample http header
    Accept-Language: es-ES, en-US, it-IT 

    The header value is not strictly enforced, so the API will always try to return data whenever possible.  If you specify a particular language and the member doesn't have matching profile data, it will fall back to returning data in the member's primary language rather than returning nothing at all.

  • Before you get started …

    Please make sure to read the Getting Started with the JavaScript SDK guide.  It contains important information to successfully incorporate signing in with LinkedIn within your application.

    Step 1 - Initialize the SDK

    In order to use any of the functionality provided by the JavaScript SDK, it must be included in your webpage's <head> section.  Follow the directions in the getting started guide to initialize the SDK.

     

    Step 2 - Create the "Sign In with LinkedIn" button

    Place the following special <script> block in your HTML wherever you want the "Sign in with LinkedIn" button to be rendered:

    Javascript
    <script type="in/Login"></script>

    This will generate a button that looks like the image below.  Note that the text on the button is presented in English by default, but can be localized to other languages using the lang argument when initializing the SDK.

    • Sign In Button

    Step 3 - Handle async authentication & retrieve basic member data

    When a user clicks the sign in button, a pop-up window containing the LinkedIn authentication dialog will be presented.  Once the user has accepted the request and provided their LinkedIn account credentials, the window will be dismissed and the SDK will perform the back-end call to LinkedIn to silently complete the authentication process for you.  Since this request happens asynchronously, you must define a function that will listen for an auth event to be thrown so that you know that the authentication process has completed and that it is safe for your application to make further API calls.

    Use the onLoad argument in the SDK's <script> block when you initialize the SDK to choose a function to execute once the SDK has finished loading.  This function should then setup the auth event listener, as shown below.  Once an auth event is thrown, it's safe to use the SDK's generic API call wrapper, IN.API.Raw(), to make a rest API call to fetch the member's basic profile data, completing the Sign In with LinkedIn process.

    Set the authorize argument in the SDK's <script> initialization block to true to use the user's existing LinkedIn session, if available.  By default, the value is false and your users will be presented with the Sign In with Linked In button on every page load.

    javascript
    <script type="text/javascript" src="//platform.linkedin.com/in.js">
        api_key: YOUR_API_KEY_HERE
        authorize: true
        onLoad: onLinkedInLoad
    </script>
    
    <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>

    With your user authenticated, and some basic member profile data returned to you from the REST API call, you have successfully completed the Sign In with LinkedIn workflow using the JavaScript SDK and your application can now step in to continue the user experience.

  • Before you get started …

    Please make sure to read the Getting Started with the Mobile SDK for Android guide. It contains important information to successfully incorporate signing in with LinkedIn within your application.

    Step 1 - Authenticate the user

    Authenticating a user in a mobile Android environment is described in detail in the Authenticating using the Mobile SDK for Android guide.  Once you have successfully authenticated your mobile user, you can continue to the next step of the workflow.

    Step 2 - Retrieve basic profile data

    Once your mobile users have authenticated or you have otherwise established a LISession on their behalf, use the following call to retrieve their basic profile data:

    java
    String url = "https://api.linkedin.com/v1/people/~";
                    
    APIHelper apiHelper = APIHelper.getInstance(getApplicationContext());
    APIHelper.getRequest(this, url, new ApiListener() {
        @Override
        public void onApiSuccess(ApiResponse apiResponse) {
            // Success!
        }
    
        @Override
        public void onApiError(LIApiError liApiError) {
            // Error making GET request!
        }
    });

    With your user authenticated, and some basic member profile data returned to you from the REST API call, you have successfully completed the Sign In with LinkedIn workflow using the Mobile SDK for Android and your application can now step in to continue the user experience.

  • Before you get started …

    Please make sure to read the Getting Started with the Mobile SDK for iOS guide.  It contains important information and prerequisite steps that you will need to follow to successfully incorporate signing in with LinkedIn to your application.

    Step 1 - Authenticate the user

    Authenticating a user in the iOS environment is described in detail in the Authenticating using the Mobile SDK for iOS guide.

    Step 2 - Retrieve basic profile data

    Once your mobile user has authenticated and you have successfully established a LinkedInConnection on their behalf, use the following call to retrieve some basic profile details for the member:

    Objective-c
    NSString *url = [NSString initWithString:@"https://api.linkedin.com/v1/people/~"];
    
    if ([LISDKSessionManager hasValidSession]) {
        [[LISDKAPIHelper sharedInstance] getRequest:url
        success:^(LISDKAPIResponse *response) {
            // do something with response
        }
        error:^(LISDKAPIError *apiError) {
            // do something with error
        }];
    ]}

    With your user authenticated, and some basic member profile data returned to you from the REST API call, you have successfully completed the Sign In with LinkedIn workflow using the Mobile SDK for iOS and your application can now step in to continue the user experience.

Image Resources

Download official Sign In with LinkedIn button images in high and low res, large and small formats from the LinkedIn Brand Resources archive for use in your project.

Permissions and Limits

Required permission: r_basicprofile

Whether set as a default permission in your app settings or requested specifically via the scope argument during your authentication process, you will need to request the r_basicprofile member permission in order for your application to successfully make the API call to sign in with LinkedIn.

Throttle limits

Throttle Type
Daily Call Limit (UTC)
Application maximum                                                                        
100,000
Per individual usern/a
Per individual developern/a

Some of the companies using Sign In with LinkedIn