alert-pharmacist-711
11/08/2024, 10:51 PMbrief-egg-61061
11/08/2024, 10:52 PMbrief-egg-61061
11/08/2024, 10:52 PMyaml selfservice: methods: code: enabled: true config: lifespan: 15m flows: recovery: enabled: true lifespan: 15m use: code notify_unknown_recipients: false
This configuration enables the code recovery method, sets the lifespan for the recovery code to 15 minutes, and configures the recovery flow to use the code method. Here's a breakdown of the key settings: 1. selfservice.methods.code.enabled: true
enables the code method for recovery. 2. selfservice.flows.recovery.enabled: true
enables the recovery flow. 3. selfservice.flows.recovery.use: code
specifies that the code method should be used for recovery. You can adjust the lifespan
values according to your needs. The notify_unknown_recipients
option is set to false
by default, but you can enable it if you want to send notifications to unregistered addresses. Remember to update your Ory Kratos configuration file with these settings to enable code recovery in your self-hosted environment. [Source: Kratos Documentation - Account recovery and password reset](https://www.ory.sh/docs/kratos/self-service/flows/account-recovery-password-reset#configuration)alert-pharmacist-711
11/09/2024, 12:18 AMbrief-egg-61061
11/09/2024, 12:18 AMbrief-egg-61061
11/09/2024, 12:19 AMyaml selfservice: default_browser_return_url: <https://your-default-redirect-url.com/>
2. For a specific redirect URL after the recovery flow: yaml selfservice: flows: recovery: after: default_browser_return_url: <https://your-recovery-specific-redirect-url.com/>
3. If you want to set a redirect URL specifically for the code method: yaml selfservice: flows: recovery: after: code: default_browser_return_url: <https://your-code-recovery-specific-redirect-url.com/>
These configurations allow you to specify where the user should be redirected after successfully completing the code recovery process. Additionally, if you want to use dynamic return URLs, you can whitelist allowed domains: yaml selfservice: allowed_return_urls: - <https://www.your-app-domain.com/>
This allows you to use the ?return_to=
query parameter when initializing the recovery flow, enabling more flexible redirects while preventing open redirect attacks. Remember to update your Ory Kratos configuration file with these settings to configure the post-recovery redirect URL in your self-hosted environment. [Source: HTTP redirection configuration](https://www.ory.sh/docs/kratos/concepts/browser-redirect-flow-completion#redirection)alert-pharmacist-711
11/09/2024, 12:26 AMselfservice:
flows:
recovery:
after:
default_browser_return_url: <https://your-recovery-specific-redirect-url.com/>
brief-egg-61061
11/09/2024, 12:26 AMbrief-egg-61061
11/09/2024, 12:26 AMyaml selfservice: flows: recovery: after: default_browser_return_url: <https://your-recovery-specific-redirect-url.com/>
Note that the URL should not be enclosed in angle brackets (<>
). Here are a few important points to keep in mind: 1. Make sure this configuration is part of your Ory Kratos configuration file (often named kratos.yml
or similar). 2. The URL you specify should be a valid, fully-qualified URL that points to the page you want users to see after completing the recovery process. 3. If you're using this in a production environment, ensure that the URL uses HTTPS for security. 4. After making changes to the configuration file, you'll need to restart your Ory Kratos instance for the changes to take effect. If you're still experiencing issues after making this correction, it might be helpful to check the rest of your configuration and ensure there are no conflicting settings. Also, verify that your Ory Kratos instance is picking up the updated configuration file. [Source: HTTP redirection configuration](https://www.ory.sh/docs/kratos/concepts/browser-redirect-flow-completion#redirection)alert-pharmacist-711
11/09/2024, 1:35 AMbrief-egg-61061
11/09/2024, 1:35 AMbrief-egg-61061
11/09/2024, 1:35 AMyaml selfservice: flows: settings: required_aal: highest_available
This configuration forces users to provide the highest authentication factor available to access their account settings, which includes the recovery flow. Here's what this means: 1. Users without a second factor configured can access the settings after they sign in with their password. 2. Users that have a second factor set up (such as TOTP or WebAuthn) will be required to complete the second factor challenge to access account settings and perform recovery. If you want to enforce MFA for all users that have configured a second factor, not just for account settings but for using your app in general, you can also add this configuration: yaml session: whoami: required_aal: highest_available
Remember to update your Ory Kratos configuration file with these settings and restart your Kratos instance for the changes to take effect. [Source: Kratos Documentation - Configure multi-factor authentication](https://www.ory.sh/docs/kratos/self-hosted/mfa#enforce-mfa) [Source: Kratos Documentation - Require multi-factor for account recovery](https://www.ory.sh/docs/kratos/self-service/flows/account-recovery-password-reset#require-multi-factor-for-account-recovery)