CommunitiesUtil Class

Contains methods for getting information about an Experience Cloud user.

Auth

The following example directs a guest (unauthenticated) user to one page, and authenticated users of the Experience Cloud site’s parent organization to another page.

The following are methods for CommunitiesUtil. All methods are static.

  • getLogoutUrl()

    Returns the page to display after the current Experience Cloud user logs out.

  • getUserDisplayName()

    Returns the current user’s Experience Cloud display name.

  • isGuestUser()

    Indicates whether the current user isn’t logged in to the Experience Cloud site. Redirect the user to log in, if necessary.

  • isInternalUser()

    Indicates whether the current user is logged in as a member of the parent Salesforce organization, such as an employee.

Returns the page to display after the current Experience Cloud user logs out.

public static String getLogoutUrl()

Type: String

Returns the current user’s Experience Cloud display name.

public static String getUserDisplayName()

Type: String

Indicates whether the current user isn’t logged in to the Experience Cloud site. Redirect the user to log in, if necessary.

public static Boolean isGuestUser()

Type: Boolean

Indicates whether the current user is logged in as a member of the parent Salesforce organization, such as an employee.

public static Boolean isInternalUser()

Type: Boolean