This example shows how to call some methods on the Auth.AuthConfiguration class. Before you can run this sample, you must provide valid values for the URLs and developer name.
String communityUrl = '<Add URL>'; String startUrl = '<Add URL>'; Auth.AuthConfiguration authConfig = new Auth.AuthConfiguration(communityUrl,startUrl); List<AuthProvider> authPrvs = authConfig.getAuthProviders(); String bColor = authConfig.getBackgroundColor(); String fText = authConfig.getFooterText(); String sso = Auth.AuthConfiguration.getAuthProviderSsoUrl(communityUrl, startUrl, 'developerName');
The following are constructors for AuthConfiguration.
public AuthConfiguration(String communityOrCustomUrl, String startUrl)
public Boolean getAllowInternalUserLoginEnabled()
If true, internal users log in to a community from the community login page with their internal credentials. If they navigate to their internal org from the community, they don't have to log in again.
public List<AuthConfigProviders> getAuthConfigProviders()
Type: List<AuthConfigProviders>
A list of authentication providers (AuthConfigProviders sObjects), which are children of the AuthProvider sObject.
public List<AuthProvider> getAuthProviders()
Type: List<AuthProvider>
A list of authentication providers (AuthProvider sObjects) for the community or My Domain subdomain.
public static String getAuthProviderSsoDomainUrl(String communityUrl, String startUrl, String developerName)
The URL for the community subdomain. If null or specified as an empty string, you get the single sign-on URL for the org’s My Domain.
The page that users see after logging in to the community subdomain.
public static String getAuthProviderSsoUrl(String communityUrl, String startUrl, String developerName)
Type: String
The Single Sign-On Initialization URL for the community or Salesforce My Domain subdomain.
public static String getCertificateLoginUrl(String domainUrl, String startUrl)
Type: String
The certificate-based authentication endpoint for the My Domain URL: mydomainURL:8443/services/certauth?startURL=startURLParam
public String getLoginRightFrameUrl()
Type: String
URL for the right-frame content of the community login page. Salesforce creates an inline (IFrame) on the right side of the login page to display the contents specified by the URL.
public List<SamlSsoConfig> getSamlProviders()
Type: List<SamlSsoConfig>
A list of SAML-based authentication providers, which are SamlSsoConfig sObjects.
public static String getSamlSsoUrl(String communityUrl, String startURL, String samlId)
Type: String
The Single Sign-On Initialization URL for the community or Salesforce My Domain subdomain.
public Boolean getSelfRegistrationEnabled()
Type: Boolean
public Boolean getUsernamePasswordEnabled()
Type: Boolean
public Boolean isCommunityUsingSiteAsContainer()
Type: Boolean