# Set Authentication

The **Set Authentication** Action transitions the user from an Authentication App to a Secure App. In an authentication workflow, a user will log in using an Authentication App (entering their password). When the user has logged in successfully, they will be redirected to the Secure App.

All these flows are controlled through **Settings > Global > App Authentication Type**.

![](https://3088276961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC6qMwMGWBgxnN70QsDuH%2Fuploads%2Fgit-blob-e00c0edcb5c3d8d32ab0d02dd2681d26db02f525%2Fthe-set-authentication-action-v182-0.png?alt=media)

&#x20;

## Use Cases

* After an authentication Data Flow is run, use a Condition Action to run the Set Authentication Action if authentication was successful, or display an error message if it was not.

## Properties

### Backup Redirect URL

Expects type `text`.

When the user authenticates through the Authentication App, they will be redirected to the Secure App.

If the user attempts to visit the Secure App before authenticating, they will be sent to the Authentication App with a **Redirect URL**. That Redirect URL should point to the Secure App. After authenticating, the user will be redirected to the URL stored in the Redirect URL.

However, if the user goes to the Authentication App first, there will be no Redirect URL set. In this case, or if the Secure App doesn't specify a Redirect URL, the **Backup Redirect URL** is used instead. The Backup Redirect URL should point to the Secure App.

### Payload

Expects type `text`.

When the Authentication App successfully redirects to the Secure App, the value specified in **Payload** will be sent to the Secure App via its `session.start`.

### Cookie Expiration in Milliseconds

Expects type `number`.

After the user successfully authenticates through the Authentication App, a cookie will be set on their device that will keep them logged in. This value determines how long that cookie will last before expiring.

After the cookie expires, the user will need to authenticate through the Authentication app again in order to receive a new cookie.

\[block:image] { "images": \[ { "image": \[] } ] } \[/block]
