function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Marcelo CostaMarcelo Costa 

Chose a SSO automatically.

Hi Everyone,
I have a issue in a customer, where we have 2 portals installed, and 2 different sso solutions at the same time.
Regular salesforce users log in through or custom url.
Customers from portal 1 go through IDP 1
Customer from portal 2 o trough IDP 2
Both IDP SSO configs are SP initiated (they have to start on salesforce).
My issue is:
I need a way to avoid going to the login page and actively chose one of the logins methods.
Salesforce generate the login links as follows:


Is there a way to programatically chose a connection method or to manually generate the saml_request_id
Anyone has any thoughts on how achieve that without going the IDP initiated SSO???
What I can understand from your problem is that you want to skip the salesforce login url page.
And directly hit the SSO login methods.
In my domains management > my domain page.
In the authentication configuration > Authentication Service > Uncheck Login page and check the IDP option, this disables the salesforce standard login page, instead will use the IDP for default login.

Let me know if that helped.
Hi Marcelo Costa,
Did you find any workaround about the issue? I am looking similar one?
Vikas Chawla 22Vikas Chawla 22
Facing same issue how can i programatically chose a connection method or to manually generate the saml_request_id in case of having multiple login options in salesforce community
Le NguyenLe Nguyen

In the controller you can use:

String startUrl = '/';
String communityUrl = '';
String samlId = '0LExxxxxxxxx'; //

String requestSAMLURL = Auth.AuthConfiguration.getSamlSsoUrl(communityUrl, startUrl, samlId);  <== This going to get the link base on or SSO ID.