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
Jose ZunigaJose Zuniga 

getting some SSO settings from APEX

Is there anyway to obtain the values (using Apex) of the next fields filled up in the SSO page settings:

Entity ID
Portal Community Login URL
Salesforce Login URL

Thanks
Best Answer chosen by Jose Zuniga
UC InnovationUC Innovation
The SamlSsoConfig object might be useful to you here:

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_samlssoconfig.htm

It looks like Audience maps to Entity ID.  Not sure if can get the other two fields though:

SamlSsoConfig sso = [SELECT Audience from SamlSsoConfig LIMIT 1];

System.Debug(sso);

All Answers

UC InnovationUC Innovation
The SamlSsoConfig object might be useful to you here:

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_samlssoconfig.htm

It looks like Audience maps to Entity ID.  Not sure if can get the other two fields though:

SamlSsoConfig sso = [SELECT Audience from SamlSsoConfig LIMIT 1];

System.Debug(sso);
This was selected as the best answer
Jose ZunigaJose Zuniga
Do you know what is the variable in SSO config that makes Audience to change or get updated?
We refreshed DEV from PROD and this query returns the same answer for both environments.
UC InnovationUC Innovation
I believe if you refresh from PROD, DEV will get the same SSO settings as PROD since it's a copy of PROD.  The only thing that I noticed is different is the my domain name, since they are different between production and sandbox.  I just recently refreshed a sandbox, and it took all the SSO settings from PROD.