@@ -28,7 +28,7 @@ configure account recovery in your Ory project.
2828<TabItem value="console">
2929```
3030
31- ** Enable and configure account recovery**
31+ ### Enable and configure account recovery
3232
33331 . Log in to your [ Ory Console] ( https://console.ory.sh/ )
34342 . Select your workspace and project
@@ -42,11 +42,21 @@ configure account recovery in your Ory project.
4242</BrowserWindow>
4343```
4444
45- ** Recovery strategy**
45+ ### Enable SMS account recovery
46+
47+ Enable the feature flag ` choose_recovery_address ` to be able to send a recovery code via SMS.
48+
49+ 1 . Log in to your [ Ory Console] ( https://console.ory.sh/ )
50+ 2 . Select your workspace and project
51+ 3 . Navigate to <ConsoleLink route = " project.settings.advanced" />
52+ 4 . Toggle "Receive a recovery code via SMS" to 'on'
53+ 5 . Click ** Save**
54+
55+ ### Recovery strategy
4656
4757You can choose between the following recovery strategies:
4858
49- - One-time passwords: Sends a one-time code via email
59+ - One-time passwords: Sends a one-time code via email, or SMS (with the feature flag ` choose_recovery_address ` enabled)
5060- Magic link: Sends a recovery link via email
5161
52621 . In the Account recovery section
@@ -68,7 +78,7 @@ import BrowserWindow from "@site/src/theme/BrowserWindow"
6878<TabItem value="cli">
6979```
7080
71- ** Download your current configuration**
81+ ### Download your current configuration
7282
7383First, get your current identity configuration:
7484
@@ -81,9 +91,14 @@ ory list projects --workspace <workspace-id>
8191
8292# Get the configuration
8393ory get identity-config --project < project-id> --workspace < workspace-id> --format yaml > identity-config.yaml
94+
95+ # Toggle the feature flag 'on'
96+ ory patch project --replace ' /services/identity/config/feature_flags/choose_recovery_address=true'
97+
98+ ory get project --format=' jsonpointer=/services/identity/config/feature_flags/choose_recovery_address'
8499```
85100
86- ** Edit recovery configuration**
101+ ### Edit recovery configuration
87102
88103Add or modify the recovery section in your configuration file:
89104
@@ -102,7 +117,7 @@ selfservice:
102117 notify_unknown_recipients : false # Define if the system sends automated recovery notifications to unknown email addresses.
103118` ` `
104119
105- ** Update your configuration**
120+ ### Update your configuration
106121
107122After editing, update your configuration:
108123
@@ -135,9 +150,43 @@ When a user initiates account recovery:
135150
136151### User flow
137152
153+ When the feature flag ` choose_recovery_address ` is enabled and the ` code ` method is in use:
154+
155+ 1 . They enter their email address on the recovery page
156+ 2 . If they have multiple recovery addresses, they can pick which one to use
157+ 3 . They receive a one-time code on their recovery address, via email or SMS, depending on the type of address
158+ 4 . After entering the code, they're prompted to set a new password
159+ 5 . Once completed, they regain access to their account with a new password
160+
161+ ---
162+
163+ When the feature flag ` choose_recovery_address ` is disabled, or the ` link ` method is in use:
164+
1381651 . They enter their email address on the recovery page
1391662 . They receive either:
140167 - A recovery link via email if using the ` link ` method
141168 - A one-time code via email if using the ` code ` method
1421693 . After clicking the link or entering the code, they're prompted to set a new password
1431704 . Once completed, they regain access to their account with a new password
171+
172+ ## What happens if the address provided by the user is 'wrong'?
173+
174+ If the address is malformed, or well-formed but not registered as a recovery address for this user:
175+
176+ - The recovery flow will not complete. This means that no recovery code will be generated and sent.
177+ - The UI will look indistinguishable from the case of a valid recovery address provided. That is to prevent an attacker from
178+ probing the system to discover which addresses are registered.
179+ - If the address is a valid email address but not registered as a recovery address for this user, and the configuration value
180+ ` selfservice.flows.recovery.notify_unknown_recipients ` is enabled, an email will be sent to this address with this wording (this
181+ can be [ customized] ( ../../kratos/emails-sms/sending-emails-smtp#send-emails-using-an-http-server ) ):
182+ > Hi,
183+ >
184+ > you (or someone else) entered this email address when trying to recover access to an account.
185+ >
186+ > However, this email address is not on our database of registered users and therefore the attempt has failed.
187+ >
188+ > If this was you, check if you signed up using a different address.
189+ >
190+ > If this was not you, please ignore this email.
191+ - If the address is a phone number (meaning a SMS would be sent), or if the configuration value
192+ ` selfservice.flows.recovery.notify_unknown_recipients ` is disabled, nothing will be sent.
0 commit comments