AuthConfiguration Class
Namespace
Example
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 = 'MyDomainName.my.site.com';
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');
AuthConfiguration Constructors
AuthConfiguration(communityOrCustomUrl, startUrl)
Signature
public AuthConfiguration(String communityOrCustomUrl, String startUrl)
Parameters
- communityOrCustomUrl
- Type: String
- The URL for the domain, which can be a Salesforce subdomain created with My Domain (my.salesforce.com) or a subdomain of an Experience Cloud site (force.com).
- startUrl
- Type: String
- The page users see after successfully logging in to the Experience Cloud site or My Domain subdomain.
AuthConfiguration Methods
getAllowInternalUserLoginEnabled()
Signature
public Boolean getAllowInternalUserLoginEnabled()
Return Value
Usage
If true, internal users log in to an Experience Cloud site from the site’s login page with their internal credentials. If they navigate to their internal org from the Experience Cloud site, they don't have to log in again.
getAuthConfig()
Signature
public AuthConfig getAuthConfig()
Return Value
Type: AuthConfig
The AuthConfig sObject for the Experience Cloud site or Salesforce My Domain subdomain.
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 Experience Cloud site or My Domain subdomain.
getAuthProviderSsoDomainUrl(communityUrl, startUrl, developerName)
Signature
public static String getAuthProviderSsoDomainUrl(String communityUrl, String startUrl, String developerName)
Parameters
- communityUrl
- Type: String
-
The URL for the Experience Cloud site subdomain. If null or specified as an empty string, you get the single sign-on URL for the org’s My Domain.
- startUrl
- Type: String
-
The page that users see after logging in to the Experience Cloud site subdomain.
- developerName
- Type: String
- The unique name of the authentication provider.
Return Value
Type: String
The Single Sign-On Initialization URL for the Experience Cloud site subdomain.
getAuthProviderSsoUrl(communityUrl, startUrl, developerName)
Signature
public static String getAuthProviderSsoUrl(String communityUrl, String startUrl, String developerName)
Parameters
- communityUrl
- Type: String
- The URL for the Experience Cloud site or My Domain subdomain. If not null and not specified as an empty string, you get the URL for the Experience Cloud site. 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 Experience Cloud site or My Domain subdomain.
- developerName
- Type: String
- The unique name of the authentication provider.
Return Value
Type: String
The Single Sign-On Initialization URL for the Experience Cloud site or Salesforce My Domain subdomain.
getCertificateLoginUrl(domainUrl, startUrl)
Signature
public static String getCertificateLoginUrl(String domainUrl, String startUrl)
Parameters
Return Value
Type: String
The certificate-based authentication endpoint for the My Domain URL: mydomainURL:8443/services/certauth?startURL=startURLParam
getForgotPasswordUrl()
getHeadlessForgotPasswordEnabled()
Signature
public Boolean getHeadlessForgotPasswordEnabled()
Return Value
Type: Boolean
getHeadlessFrgtPswEnabled()
Signature
public Boolean getHeadlessFrgtPswEnabled()
Return Value
Type: Boolean
getHeadlessPasswordlessLoginEnabled()
Signature
public Boolean getHeadlessPasswordlessLoginEnabled()
getHeadlessRegistrationEnabled()
Signature
public Boolean getHeadlessRegistrationEnabled()
getRightFrameUrl()
Signature
public String getLoginRightFrameUrl()
Return Value
Type: String
URL for the right-frame content of the Experience Cloud site login page. Salesforce creates an inline (iframe) on the right side of the login page to display the contents specified by the URL.
getSamlProviders()
Signature
public List<SamlSsoConfig> getSamlProviders()
Return Value
Type: List<SamlSsoConfig>
A list of SAML-based authentication providers, which are 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 Experience Cloud site or My Domain subdomain. If not null and not specified as an empty string, you get the URL for the Experience Cloud site. If null or specified as an empty string, you get the URL for a My Domain subdomain.
- startUrl
- Type: String
- The page users see after successfully logging in to the Experience Cloud site or My Domain subdomain
- samlId
- Type: String
- The unique identifier of the SamlSsoConfig standard object for the Experience Cloud site or My Domain subdomain
Return Value
Type: String
The Single Sign-On Initialization URL for the Experience Cloud site or Salesforce My Domain subdomain.
getSelfRegistrationEnabled()
Signature
public Boolean getSelfRegistrationEnabled()
Return Value
Type: Boolean
getSelfRegistrationUrl()
getStartUrl()
Signature
public String getStartUrl()
Return Value
Type: String
The location of the start page for the Experience Cloud site or My Domain subdomain.
getUsernamePasswordEnabled()
Signature
public Boolean getUsernamePasswordEnabled()
Return Value
Type: Boolean
isCommunityUsingSiteAsContainer()
Signature
public Boolean isCommunityUsingSiteAsContainer()
Return Value
Type: Boolean