This example shows how to call some methods on the Auth.AuthConfiguration class. Before you can run this sample, you need to 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 custom domain.
public static String getAuthProviderSsoUrl(String communityUrl, String startUrl, String developerName)
public List<SamlSsoConfig> getSamlProviders()
Type: List<SamlSsoConfig>
A list of SAML-based authentication providers (SamlSsoConfig sObjects).
public static String getSamlSsoUrl(String communityUrl, String startURL, String samlId)
public Boolean getSelfRegistrationEnabled()
Type: Boolean
public Boolean getUsernamePasswordEnabled()
Type: Boolean
public Boolean isCommunityUsingSiteAsContainer()
Type: Boolean