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 Methods
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(communityOrCustomUrl, startUrl, developerName)
Signature
public static String getAuthProviderSsoUrl(String communityOrCustomUrl, String startUrl, String developerName)
Parameters
- communityOrCustomUrl
- Type: String
- The URL for the community or custom domain. 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(communityOrCustomUrl, startURL, samlId)
Signature
public static String getSamlSsoUrl(String communityOrCustomUrl, String startURL, String samlId)
Parameters
- communityOrCustomUrl
- Type: String
- The URL for the community or custom domain. If null or specified as an empty string, you’ll 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 name of the SAML configuration for thecommunity or custom domain.
getSelfRegistrationEnabled()
Signature
public Boolean getSelfRegistrationEnabled()
Return Value
Type: Boolean
getSelfRegistrationUrl()
getUsernamePasswordEnabled()
Signature
public Boolean getUsernamePasswordEnabled()
Return Value
Type: Boolean