<@U04UQ68083H> in ory kratos self-hosted, can I re...
# ory-copilot
a
@chilly-king-10285 in ory kratos self-hosted, can I require
highest_available
aal only on session cookie requests, and
aal1
for session token requests?
b
A message from kapa.ai
Yes, in Ory Kratos self-hosted, you can configure different Authenticator Assurance Level (AAL) requirements for session cookie requests and session token requests. This can be achieved by adjusting the configuration in your Kratos configuration file. To implement this setup: 1. For session cookie requests (typically used in browser-based flows), set the
required_aal
to
highest_available
. 2. For session token requests (typically used in API or mobile app scenarios), set the
required_aal
to
aal1
. Here's how you can configure this in your
kratos.yml
file:
Copy code
yaml session:   whoami:     required_aal: aal1  selfservice:   flows:     settings:       required_aal: highest_available
In this configuration: - The
session.whoami.required_aal: aal1
setting applies to session token requests, allowing access with just the first factor authentication. - The
selfservice.flows.settings.required_aal: highest_available
setting applies to browser-based flows, requiring the highest available authentication level for accessing user settings. This configuration allows you to enforce stricter authentication for browser-based interactions while maintaining a lower authentication requirement for API or mobile app scenarios. For more detailed information on configuring multi-factor authentication in self-hosted Ory Kratos, you can refer to the [Ory Kratos MFA documentation](https://www.ory.sh/docs/kratos/self-hosted/mfa).
a
@chilly-king-10285 Can you explain what the
selfservice.flows.settings.required_aal
applies to? Is it only settings flows?
b
A message from kapa.ai
The
selfservice.flows.settings.required_aal
configuration primarily applies to the settings flow in Ory Kratos, but its implications can extend beyond just the settings flow. Let me explain in more detail: 1. Settings Flow: The most direct application of this configuration is to the settings flow. When set to
highest_available
, it requires users to authenticate with the highest level of authentication they have available before they can access or modify their account settings. 2. Other Self-Service Flows: While the configuration is named for the settings flow, it can affect other self-service flows as well. According to the [Ory Kratos User Settings & Profile Management Documentation](https://www.ory.sh/docs/kratos/reference/api), this setting can impact how other flows behave when they interact with user settings or require a privileged session. 3. Step-up Authentication: As described in the [Ory Step-up Authentication documentation](https://www.ory.sh/docs/kratos/mfa/step-up-authentication), this setting is part of the broader multi-factor authentication enforcement model. When set to
highest_available
, it enforces a strict model where secured operations always require the highest Authenticator Assurance Level (AAL). 4. Impact on Other Operations: The setting can affect other high-risk operations via self-service endpoints. For example, if a user tries to perform an action that requires elevated privileges, they might be prompted to authenticate with their highest available factor, even if they're not directly in the settings flow. 5. Session Behavior: This setting can influence how sessions are handled when interacting with settings-related operations. If a user's current session doesn't meet the required AAL, they may be prompted to authenticate further before proceeding. It's important to note that while this setting is primarily focused on the settings flow, its effects can be felt across the user's interaction with the system, especially for operations that require elevated privileges or access to sensitive information. For a more comprehensive understanding of how this setting interacts with other configurations and flows, I recommend reviewing the [Ory Kratos MFA documentation](https://www.ory.sh/docs/kratos/self-hosted/mfa) and the [Ory Step-up Authentication guide](https://www.ory.sh/docs/kratos/mfa/step-up-authentication).