# Adaptive authentication

**Adaptive authentication** lets OpenIAM change the sign-in flow based on context. Instead of using only a fixed method such as password, OTP, or certificate, you can evaluate signals like IP address, role, or device status during authentication.

Use adaptive authentication when you need to require an extra step, allow access only under specific conditions, or block a login attempt.

### Authentication rules

Authentication rules define the sequence of steps that OpenIAM uses during sign-in. A rule can contain one authentication method, several methods in order, a choice between methods, or adaptive conditions that change the flow.

### Configure authentication rules

{% stepper %}
{% step %}

### Open authentication rules

In the **Webconsole**, go to **Policy → Authentication Rule**.

<figure><img src="/files/95ed3c5bce584975c86bd3b6d7ad7623fa9e5d6c" alt=""><figcaption></figcaption></figure>

The default list includes rules for the standard authentication types.

<figure><img src="/files/87c17960df3e5b8e5b0656e37bbfedbbc84973b8" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create a one-step authentication rule

Use a one-step rule when you want a single authentication method.

Drag a step type from **Step types** into **Authentication rule steps**. Then connect the step in the rule designer.

<figure><img src="/files/2186e79dff32a8611b4915352c39cc7fd6f7ad64" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create a multi-step authentication rule

Use a multi-step rule when users must complete more than one authentication method.

Drag the required step types into **Authentication rule steps**. Arrange them in the required order. Then connect the steps to define the sequence.

<figure><img src="/files/5fd368690521a3b88616b05d473db4c41f5fdd28" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Let users choose from multiple authentication methods

If you support several authentication methods, you can let the user choose one from an allowed list.

Use the rule type shown below to branch to multiple supported methods.

<figure><img src="/files/58c5b5943067467610d3e1e54987366333486bf3" alt=""><figcaption></figcaption></figure>

In this example, after a successful password login, the user is redirected to a selection page with the available authentication methods.

![alt text](/files/e1c0f60596ada3238fda982d1890801eb027c35c)
{% endstep %}

{% step %}

### Add adaptive authentication conditions

Use adaptive risks when the flow should change based on context. For example, you may want to require an extra step for a new device or allow access only for a specific role.

Drag the required adaptive risk from **Drag required adaptive risk** into the rule designer.

The example below adds an extra authentication step when the user signs in from a new device.

<figure><img src="/files/01817dd665a70bba70b359ce0c90d394d56769a7" alt=""><figcaption></figcaption></figure>

The next example allows access only for a selected role.

<figure><img src="/files/61f6dadef4d7d738d367ddef5cbb2b09ed6205b2" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

Each adaptive risk returns either `true` or `false`. Use that result to decide the next step in the flow, require additional authentication, or deny access.


---

# Agent Instructions: 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:

```
GET https://docs-beta.openiam.com/configuring-multi-factor-authentication/adaptive-authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
