I would like to customize community login page. At the same time I have enabled SSO authentication for the community.

Is it possible to add "SSO Login button" to the custom login page?

3 Answers 3


Refer this link where it says

Login to Salesforce Org where the custom domain was configured as a Salesforce Administrator and navigate to Setup>>Domain Management>>My Domain. Once the "My Domain" page loads scroll down to the section titled "Login Page Branding" and click edit. Next to the "Authentication Service" section there are two check boxes Login Page and IdentityConnect. Ensure the IdentityConnect checkbox is checked if not check it and Save. Checking this box enables the Identity Connect SSO (Single Sign On) button to show on the domain login screen.

  • In this case a SSO login button will be added to the My Domain standard login page. In my case we do not use My Domain functionality. We only use Communities.
    – steals
    Commented Jan 22, 2015 at 11:28
  • This answer is for main login page for internal users. Commented Apr 22, 2021 at 6:00

Better to use the getSamlSsoUrl from the AuthConfiguration class:

String communityUrl = '<Site URL of the Community>';
String startUrl = '/s';

Auth.AuthConfiguration authConfig = new Auth.AuthConfiguration(communityUrl, startUrl);

List<SamlSsoConfig> samlConfigList = [SELECT DeveloperName, Id FROM SamlSsoConfig WHERE DeveloperName = : 'SSO Unique Name'];
Id samlId = samlConfigList[0].Id;

String sso = Auth.AuthConfiguration.getSamlSsoUrl(communityUrl, startUrl, samlId);


Find the answer by myself.
Go to the Setup -> Single Sign-On Settings
Open required SSO configuration and copy "Identity Provider Login URL" value.
Add regular apex:commandButton and action in the controller that returns Page reference to the "Identity Provider Login URL"

  • Did this really work? I think it no longer works??? In our case there are potentially more parameters to inform the IP, of the SP. Commented Apr 22, 2021 at 6:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .