> For the complete documentation index, see [llms.txt](https://docs.rierino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rierino.com/devops/api-event-and-process-flows/configuring-saga-steps/event-step/gateway-actions/authenticate/state-based.md).

# State Based

## State Based Actions

### Login

Extra event metadata parameters for this action are as follows:

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

| Parameter          | Definition                                                                                                  | Example | Default                 |
| ------------------ | ----------------------------------------------------------------------------------------------------------- | ------- | ----------------------- |
| Expiration         | Seconds for expiration of access token for a specific login action                                          | 300     | Handler's configuration |
| Refresh Expiration | Seconds for expiration of refresh token for a specific login action                                         | 1800    | Handler's configuration |
| No Tokens          | Whether this login activity should skip generating tokens and validate credentials only (e.g. step for MFA) | true    | false                   |
| Roles in ID        | Whether user roles should be included in ID token in addition to profile                                    | true    | false                   |

{% endtab %}

{% tab title="JSON Schema" %}

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "State Based Login action eventMeta.parameters",
  "type": "object",
  "properties": {
    "eventMeta": {
      "type": "object",
      "properties": {
        "parameters": {
          "type": "object",
          "properties": {
            "expiration": {
              "type": "string",
              "definition": "Seconds for expiration of access token for a specific login action",
              "example": "300",
              "default": "Handler's configuration"
            },            
            "refreshExpiration": {
              "type": "string",
              "definition": "Seconds for expiration of refresh token for a specific login action",
              "example": "1800",
              "default": "Handler's configuration"
            },            
            "noTokens": {
              "type": "string",
              "definition": "Whether this login activity should skip generating tokens and validate credentials only (e.g. step for MFA)",
              "example": "true",
              "default": "false"
            },            
            "rolesInID": {
              "type": "string",
              "definition": "Whether user roles should be included in ID token in addition to profile",
              "example": "true",
              "default": "false"
            }
          }
        }
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Refresh

Extra event metadata parameters for this action are as follows:

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

| Parameter          | Definition                                                                                                  | Example | Default                 |
| ------------------ | ----------------------------------------------------------------------------------------------------------- | ------- | ----------------------- |
| Allow Unregistered | Whether refresh tokens should be valid if they don't belong to users in auth.state                          | true    | false                   |
| Expiration         | Seconds for expiration of access token for a specific login action                                          | 300     | Handler's configuration |
| Refresh Expiration | Seconds for expiration of refresh token for a specific login action                                         | 1800    | Handler's configuration |
| No Tokens          | Whether this login activity should skip generating tokens and validate credentials only (e.g. step for MFA) | true    | false                   |
| Roles in ID        | Whether user roles should be included in ID token in addition to profile                                    | true    | false                   |
| {% endtab %}       |                                                                                                             |         |                         |

{% tab title="JSON Schema" %}

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "State Based Refresh action eventMeta.parameters",
  "type": "object",
  "properties": {
    "eventMeta": {
      "type": "object",
      "properties": {
        "parameters": {
          "type": "object",
          "properties": {
            "allowUnregistered": {
              "type": "boolean",
              "definition": "Whether refresh tokens should be valid if they don't belong to users in auth.state",
              "example": true,
              "default": false
            },
            "expiration": {
              "type": "string",
              "definition": "Seconds for expiration of access token for a specific login action",
              "example": "300",
              "default": "Handler's configuration"
            },            
            "refreshExpiration": {
              "type": "string",
              "definition": "Seconds for expiration of refresh token for a specific login action",
              "example": "1800",
              "default": "Handler's configuration"
            },            
            "noTokens": {
              "type": "string",
              "definition": "Whether this login activity should skip generating tokens and validate credentials only (e.g. step for MFA)",
              "example": "true",
              "default": "false"
            },            
            "rolesInID": {
              "type": "string",
              "definition": "Whether user roles should be included in ID token in addition to profile",
              "example": "true",
              "default": "false"
            }
          }
        }
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Allowing unregistered user refresh can be useful where user registration is optional and stateless authentication is used.
{% endhint %}


---

# 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.rierino.com/devops/api-event-and-process-flows/configuring-saga-steps/event-step/gateway-actions/authenticate/state-based.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.
