Enable SSO between 2 salesforce communities

02:44 5 Comments A+ a-





Hello Everyone ,
I hope you all have read my recent post. Recently I have implemented SSO between 2 salesforce communities. Let’s start how I did this using salesforce’s out of the box functionality.

Use Case: one organisation was using the salesforce and salesforce community(let's name it cloudkicks) , later they acquired another organisation another company and that company was also using the salesforce and salesforce community(name it iCourier).  Now the stakeholder of the parent organisation wanted that users of their community can login directly in the acquired company’s community portal.

So in this case cloudkicks will act as Identity provider (Source organisation) and iCourier will act as service provider (Target community where we want to login).

Following steps we need to take :
1.     Enable Identity provider in source org.
2.     Enable Single Sign on in the target org.
3.     Create a connected app in the source org.

Let’s see them step by step how that will be working.
1.     Enable Identity provider in source org:
a.     If identity provider is not already enabled in org then first enable it.
 
Once we click on the enable identity provider button we will be asked to select a certificate, you can select existing one or also can create new.
 
b.     Download metadata and certificate: Once we have enabled identity provider in our source org we need to download metadata file, which will be used for enabling single sign on in the target org.
           



2.     Enable Single Sign on in the target org
a.     SAML Enabled:
b.     Create SAML Sign-On Settings: We can click on a new button and fill all the details manually,or we can use metadata file by clicking on the ‘New from Metadata file’  button. We will use a metadata file which we used from step 1.

All details will be filled automatically. We would need to make the following changes for red highlighted fields.

Request Signature Method: RSA-SHA1
Service Provider Initiated Request Binding: HTTP POST
Identity Provider Login URL: Keep it blank for now , we will come back to it later.


3.     Create connected app in the source org: We will create a connected app in the source org (cloud kicks) .
In the connected app , enable SAML, we need some information here that will be provided by target org when they enable single sign on setting.
Lets see where we can get entity url and ACS URL from the target org.Both details are available on the detail page of single sign on setting which we created in step 2.

Entity Id :

ASC URL: Is the endpoint of login url where we need to provide login access.

Once we save connected app , click on manage button and assign profiles who will be using this connected app (cloudkicks community user profile)


Now we need to copy ‘IdP-Initiated Login URL’ and put it on the single sign on settings, remember we put 1 blank value there.
Copy from the connected app

Paste on the single sign on setting page in target org.

Now we are done with the setup. We can call this url on any button click from target community (Cloudkicks) and it will allow us to login into source org community (iCourier).

Note: We can set federation Id on user detail page, make sure federation id should be same in both orgs for a user, this will be used to authenticate the user.


Connect Blogger to Salesforce - CMS

04:40 0 Comments A+ a-


Hello All,

Before starting on the connecting blogger with salesforce I would like to highlight about what actually salesforce cms and some of its use cases.

Salesforce CMS is very simple and powerful tool.With the help of salesforce CMS user can create,manage and deliver content. It also help translation and mutlilanguage. Salesforce CMS is hybird cms, which enables us to centeralize content on a location. And embed other cms system (wordpress,drupal,blogger) data into salesforce. These systems data will be managed on the respective system itself and will reflect into salesforce.

How to connect Blogger with Salesforce:  We will use CMS connect with JSON here to connect Blogger with the salesforce.

Whitelist URL: CMS connect use CORS (Cross origin resource sharing) to access external data. we need to whitlelist public api url in the CORS and CSP both.

base url for google apis: https://www.googleapis.com

Open CMS Content for the community in which we want to show blogger data.



Click on the CMS connect and then click on the new button to create new connection.


Enter following information in the connection details section:

Name : This will be used to identify the connection, like name of any record in salesforce
CMS Source: Other (we can select any other available to make connection with them)
Connection type: Public (we are using public api with a public key)
Server URL: https://www.googleapis.com  (Make sure you have added it in the CORS and CSP)

Click on the add JSON button below in the popup. And give it a readable name.

Enter following information in the content item section. This will be used to read individual content item in the community.


Name: Blog Item
Path: blogger/v3/blogs/5011517723534616475/posts/{component}?key=AIzaSyA0ykuQ9XoVr1Q1rLYuWV8g4VUGVNJoC9E
Id Path: Field Name or Path to use as unique identifier of the content item.
Titile Path: Filed Name or path to display as title for this content item.

In the path url '5011517723534616475' is the blog id from where I will fetch my content.
{component} is used to pass component url dynamically, to make relative url in the community
key is provided by the google.  Click here to get your key from google.


Enter following information in the content list section. This will be used to fetch list of all content items.


Name: Blog Feed (It can be any relatable name)
Path: blogger/v3/blogs/5011517723534616475/posts?key=AIzaSyA0ykuQ9XoVr1Q1rLYuWV8g4VUGVNJoC9E&fetchBodies=true&maxResults=50&fetchImages=true
Node Path: items

Click on the save button. Now we need to put our dynamic content on the community.

Go to builder and drag and drop CMS connect (JSON) component on the community page where we want to display content.
Configure the following properties to display dynamic content list.


Below this we need to configure some JSON keys to display data. We can check public key by hitting the below url in the browser. This url is combination of server url (https://www.googleapis.com) and the path we put in the content list section.


Configuration for content list item layout.


Click on the save button and you can see dynamic data in component you dropped. You can publish or preview community and see all dynamic data from blogger to salesforce.

See the live demo here.



If you have any suggestion feel free to reach me out on twitter or linkedin.


Regards,
Arpit vijayvergiya
Certified Salesforce Consulant

Lightweight LWC Data Table

01:51 0 Comments A+ a-

Hi All,
Whenever we need to show many records to user with client side filtering, sorting and pagination, most of us use the jQuery Data Tables (Which is very popular).
But in Salesforce lightning, if we are working with LWC then using jQuery gives a lot of issues for us. We need a Vanilla based Data Table which gives all these features.

  1. Client Side search on records
  2. Client Side pagination
  3. Client Side sorting
  4. Client Side page size changes


To overcome this problem in LWC, we have made one Light weighted LWC Data Table, which works similar to jQuery Data Tables.

Please look the demo:



Thanks
Aslam Bari