Skip to main content

Authenticate Salesforce with LinkedIn

UntitledIn this blog post let see about how to configure social single sign-on authentication for salesforce. As part of Winter15 release salesforce provided social single sign-on using LinkedIn and twitter also. Now lets see about how to configure using LinkedIn.This allows user to login in to your salesforce organization using their social media account, this functionality can be used for both internal and external(community users). Let see step by step procedure for LinkedIn.

Create LinkedIn Application:
  • Log into your LinkedIn developer account.
  • Click on the username at the top of the page and select API keys
  • Click Add Application and enter all mandatory settings and save.
Note down the API key and Secrete key  we will use it later in salesforce

screenshot-www.linkedin.com 2014-09-04 23-27-25

LinkedIn Auth. Provider in salesforce:

Go to setup->Security control->Auth. Providers select LinkedIn in the provider, then enter the name and URL suffix. In the Consumer Key enter the API key and in the Consumer secrete enter the secret key values from the LinkedIn app. In the registration handler click “Automatically create a registration handler template” this will create the apex class for the user authentication(Lets look into that in the next step). Then click save, it will create the client configuration URLs.

screenshot-karanrajs-dev-ed.my.salesforce.com 2014-09-05 17-29-15
screenshot-by-nimbus (1)

Copy the Call back URL and then go back to the LinkedIn application paste it in the OAuth 2.0 redirect URLs value

Registration Handler class:

Open the registration handler class and update with the below code.

In the above class in the CreateUser method we are checking if any user exist in the organization with the logged in email address, if it has any user then it allow the user to login with their LinkedIn credentials else it will display the error message. If you want to display custom error page, you create a custom error page and paste the URL in the custom URL section of Auth. provider in salesforce.

In the Registration handler class you can handle the logic create new user if no match is found and allow them to login into your org. This scenario mostly used for the community users.

Where I can use?

Lets test the single sign-on functionality,open the Test-only initialization URL, then login with your LinkedIn user credentials and it will display the user details in the XML format.

screenshot-karanrajs-dev-ed.my.salesforce.com 2014-09-05 17-09-26


We can use this feature in the following ways.

Method 1 : Directly use the Single sign-on registration URL for login.

Method 2: If you have “My Domain” for you organization you can allow user to login with the LinkedIn credential. Setup->Domain Management->My domain->Login Page Branding


Untitled

Method 3: If your organization have community, you can also allow the community users to login with their LinkedIn credentials.

Revoke Access:
If admin or user later wants to revoke the linked account access, they can able to revoke under the “Third party Account Links” section in the user detail page.


Comments

  1. apple watch 6 titanium - India's top-ranking luxury retail
    › apple-watch-6-titanium-titanium-titanium-titanium › apple-watch-6-titanium-titanium-titanium-titanium-titanium-titanium-titanium-titanium-titanium. The titanium nose hoop apple titanium tv alternative watch features a 3.3" LCD screen used ford fusion titanium along titan metal with 2,920+ pure-grade crystal  Size: 3.3 x 6.9 womens titanium wedding bands x 5.9 inches Weight: 3.3 pounds

    ReplyDelete

Post a Comment

Popular posts from this blog

Avoid Duplicate Records Using Flow

In this blog post lets see how to avoid duplicate records in Salesforce using the powerful feature – Flow , As the word says, flow easily flows to fulfill the requirements with ease. ☺  Many think of appexchange solutions and source code to avoid the duplicate record in salesforce, But the method I'm going to explain here is completely different and very simple. It helps you to reduce your code and can easily rebuild for other objects with different field logic with simple clicks. Lets jump into the solution, we will use flow to check duplicate record logic and use apex trigger to initiate the Flow whenever a record is created or updated. Visual Work Flow : [Click] First we will create the Flow to check the duplicate records based on the name and store the result in the variable. In this example, we will use the Account object for the dupe check. Step 1  : Create a new visual flow with the Name ‘ DuplicateAccountCheck ' Step 2  : Click and drag the RecordLookup into t

Export records from List view – ListView API

As part of the Winter’15 release salesforce introduced the List View API features which helps us to get details and records of list views for an object. I was started exploring more about the List view API and trying to build an use case using that. So I searched about List View in the IdeaExchange site then found that many users are looking for a solution to export records to excel directly from the list view. I built a solution for that Idea, which helps user to download all the records directly from the List view for both standard and custom object. You don’t have to make any change in the code to use this functionality for different objects. All you need is to create a custom button for that object as mentioned below. Lets take an example for Account object 1. Go to Setup –> Accounts –> Buttons, Links and Actions 2. Click ‘New Button or Link' 3. Enter  Label, Name and select display type as ‘List Button’ 4. Content source as “Onclick Javascript” and paste the

Become an Apex Integration Specialist in 2 hours

In the series of my favourite trailhead module blogpost this time, I’m going to cover about one of the most expected and important developer focused trailhead module “ Apex Integration Service ”. This time salesforce launched with new a Trail and 6 badges which brings over all 13 trails and 70 shiny badges in the Trailhead. Most of the salesforce projects will have an integration with the other application in the project life cycle. As a salesforce developer, we must have a sound knowledge in Integrations and salesforce provides this free “ Apex Integration service ” trailhead module which has 4 units with the followings topics Apex Integration Overview   This overview module makes you understand the difference between the Webservice and HTTP callouts and use of external site in Webservice topic salesforce Apex REST callouts  This module covers the both consuming and sending data through REST callouts. You will learn about the Deserialize  and  serialize   JSON strings in ap