> For the complete documentation index, see [llms.txt](https://docs.fortifiedid.se/access/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fortifiedid.se/access/key-components/authenticators/flow-control/chain.md).

# Chain

Configuration and usage guidance for Chain in Fortified ID Access.

## Introduction

The chain authenticator orchestrates one or more authenticators that perform(s) the actual authentication.

The chain is complete when all (required) authenticators in the chain are completed.

A chain authenticator can be nested with [Selector](/access/key-components/authenticators/flow-control/selector.md)s and other chains.

## Configuration

{% hint style="info" %}
**Authenticator type:** `Chain`
{% endhint %}

Common Authenticator configuration can be found [here](/access/key-components/authenticators/common-configuration.md).

{% tabs %}
{% tab title="Properties" %}

| Name               | Description                                                                                                                                                                                 | Default |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `base_path`        | The base path for this authenticator *and* used to construct paths for chained authenticators. (see [Routing](#routing))                                                                    |         |
| `exec_if`          | An expression that determines if this authenticator should be executed or not.                                                                                                              |         |
| `chain`            | List of [authenticator refs](#authenticator-refs) defining the content and order of the chain. An empty chain will block the authentication and therefore at least one ref must be present. | `[]`    |
| `require_subject`  | Flag controlling if this authenticator requires a subject to be set before completing. Use only for nested chains.                                                                          | `true`  |
| `proceed_on_error` | Flag controlling how chain behaves on authenticator failure. If enabled, all authenticators in chain will be executed before error is raised (stealth behaviour).                           | `true`  |
| `require_chain`    | Flag specifying if this authenticator must be executed inside a chain.                                                                                                                      | `false` |
| `verbose`          | Turns on extended trace logging. Use for troubleshooting only.                                                                                                                              | `false` |
| {% endtab %}       |                                                                                                                                                                                             |         |

{% tab title="Example" %}

```json
{
    "id" : "chain00",
    "type" : "Chain",
    "config" : {
      "base_path" : "/test/authn",
      "success_location" : "/authn/success.html",
      "failure_location" : "/authn/failure.html",
      "chain" : [ {
        "id" : "confirm00",
        "required" : true
      }, {
        "id" : "select00",
        "required" : true
      } ]
    }
  }
```

{% endtab %}
{% endtabs %}

### Authenticator refs

An authenticator ref points to an actual authenticator available in the current configuration.

{% tabs %}
{% tab title="Property" %}

<table data-full-width="true"><thead><tr><th>Name</th><th>Description</th><th>Default</th><th data-type="checkbox">Mandatory</th></tr></thead><tbody><tr><td><code>id</code></td><td>Authenticator id</td><td></td><td>true</td></tr><tr><td><code>required</code></td><td>Flag controlling if authenticator is required to complete or not. Authentication will fail if a required authenticator does not complete.</td><td><code>true</code></td><td>false</td></tr><tr><td><code>order</code></td><td>If ALL items have order numbers, these numbers define the execution order. If NO item has an order number, the order of the list defines the execution order.</td><td></td><td>false</td></tr></tbody></table>
{% endtab %}

{% tab title="Example" %}

```json
"chain" : [ 
  {
    "id" : "confirm00",
    "required" : true,
    "order": 0
  }, 
  {
    "id" : "select00",
    "required" : true,
    "order": 1
  }
 ]
```

{% endtab %}
{% endtabs %}

### Routing

When a chain is executed, the user agent is redirected to each chained authenticator in the specified (configured) order. The path to the authenticator is constructed by combining `base_path` with the chain authenticator's ID (specified as `id` in `authenticator_ref`).

Note that `base_path` is also used to generate the path for the current authenticator. This is intentional, as all authenticators in a flow must share the same path and session, both of which are managed by the path.

## API

API not available.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fortifiedid.se/access/key-components/authenticators/flow-control/chain.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
