Is User Authenticated

Select a journey branch based on whether or not the user already authenticated in this journey

Description

This step checks if the user has successfully completed an authentication step in this journey, which authenticates the user using a login method (e.g., password or email OTP). If the user is authenticated, the journey proceeds to the Yes branch. If not, the journey proceeds to the No branch.

This step is equivalent to the @policy.isUserAuthenticated() expression. The expression form can be used in the configuration of other journey steps or external connections.

Example

Here are a few examples of how this step can be used:

Example 1: Subjourneys

Journey logic may become complex and subjourneys allow breaking it down into modular components. If a subjourney is intended for authenticated users only, you can add this step as the first step in the subjourney to ensure it's only executed for authenticated users. This enhances the security of your flows since subjourneys could be invoked from any journey.

Example 2: After while loop

Consider a While Loop step that's used to limit the number of unsuccessful authentication attempts before offering a different method (as described in this example). In the example, the loop stops when either the user successfully authenticates or exceeds 3 retries. The logic that follows the loop should be based on whether or not the user authenticated. This can be done by adding the Is User Authenticated step after the loop. The Yes branch can be used to complete the journey, while the No branch can be used to offer the user a different method.