Generate Experience User Token Node

The Generate Experience User Token Node allows a workflow to create a token for an Experience User that can be used for authorized requests against Experience Endpoints.

Generate Experience User Token Node

Node Properties

The Authenticate Experience User Node has two sections:

  • Configuration: You must specify a user for the new token. You can also configure the expiration of the token and include extra data.
  • Result Path: Payload path to store the new token.

Configuration

Generate Experience User Token Node Configuration

User ID or Email Template

The node can find an Experience User by user ID or email address, which both must be unique within the context of the application, and so will at most match a single user.

The node determines if it should find by ID or email based on the form of the input (since the ID and email addresses have different forms). This field is templatable.

Max-Age Template

You may set the Max Age of the token. This number is the number of milliseconds until the generated token expires. This field is templatable.

This value is expected to resolve to a positive number. If no number is provided, the generated token will have no expiration date.

Invalidate any previously existing authentication tokens

When this checkbox is checked, any previously existing tokens for this user are invalidated, meaning that they will no longer work to authenticate a user. This newly generated token will be the only valid token.

Treat this token generation as a login

When this checkbox is checked, this token generation is treated as a user login. This means the lastLogin property of the user will be updated to the current date, just as if a regular user Authenticate Node was used.

Extra Data Template

The extra data template is a JSON template field which allows you to add extra data to the token. This extra data will be placed on the payload of an Endpoint Trigger.

Result

The generated token is then stored at the payload path specified in the “Result Path” field.

Generate Experience User Token Node Result

If the user specified in the “ID or Email Template” field was not found, the value stored at this path on the payload will be null. Otherwise, it will be the generated token string. In the example above, the token string will be placed at the path data.generatedToken.

Node Example

Here’s an example output from running the above workflow…

{
...
"data": {
  "generatedToken": "*****REDACTED*****",
...
}

Node Errors

This node will never place an error on the workflow payload.

Was this page helpful?


Still looking for help? You can also search the Losant Forums or submit your question there.