Newer Version Available
AuthConfiguration Class
Namespace
Example
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.
1String communityUrl = '<Add URL>';
2String startUrl = '<Add URL>';
3Auth.AuthConfiguration authConfig = new Auth.AuthConfiguration(communityUrl,startUrl);
4List<AuthProvider> authPrvs = authConfig.getAuthProviders();
5String bColor = authConfig.getBackgroundColor();
6String fText = authConfig.getFooterText();
7
8String sso = Auth.AuthConfiguration.getAuthProviderSsoUrl(communityUrl, startUrl, 'developerName');AuthConfiguration Constructors
The following are constructors for AuthConfiguration.
AuthConfiguration(communityOrCustomUrl, startUrl)
Signature
public AuthConfiguration(String communityOrCustomUrl, String startUrl)
AuthConfiguration Methods
getAllowInternalUserLoginEnabled()
Signature
public Boolean getAllowInternalUserLoginEnabled()
Return Value
Usage
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.
getAuthConfigProviders()
Signature
public List<AuthConfigProviders> getAuthConfigProviders()
Return Value
Type: List<AuthConfigProviders>
A list of authentication providers (AuthConfigProviders sObjects, which are children of the AuthProvider sObject).
getAuthProviders()
Signature
public List<AuthProvider> getAuthProviders()
Return Value
Type: List<AuthProvider>
A list of authentication providers (AuthProvider sObjects) for the community or custom domain.
getAuthProviderSsoUrl(communityUrl, startUrl, developerName)
Signature
public static String getAuthProviderSsoUrl(String communityUrl, String startUrl, String developerName)
Parameters
- communityUrl
- Type: String
- The URL for the community or custom domain. If not null and not specified as an empty string, you get the URL for a community. If null or specified as an empty string, you get the URL for a custom domain.
- startUrl
- Type: String
- The page that users see after logging in to the community or custom domain.
- developerName
- Type: String
- The unique name of the authentication provider.
getForgotPasswordUrl()
getSamlProviders()
Signature
public List<SamlSsoConfig> getSamlProviders()
Return Value
Type: List<SamlSsoConfig>
A list of SAML-based authentication providers (SamlSsoConfig sObjects).
getSamlSsoUrl(communityUrl, startURL, samlId)
Signature
public static String getSamlSsoUrl(String communityUrl, String startURL, String samlId)
Parameters
- communityUrl
- Type: String
- The URL for the community or custom domain created using My Domain. If not null and not specified as an empty string, you get the URL for a community. If null or specified as an empty string, you get the URL for a custom domain.
- startUrl
- Type: String
- The page users see after successfully logging in to the community or custom domain.
- samlId
- Type: String
- The unique identifier of the SamlSsoConfig standard object for the community or custom domain.
getSelfRegistrationEnabled()
Signature
public Boolean getSelfRegistrationEnabled()
Return Value
Type: Boolean
getSelfRegistrationUrl()
getUsernamePasswordEnabled()
Signature
public Boolean getUsernamePasswordEnabled()
Return Value
Type: Boolean
isCommunityUsingSiteAsContainer()
Signature
public Boolean isCommunityUsingSiteAsContainer()
Return Value
Type: Boolean