@@ -28,7 +28,7 @@ configure account recovery in your Ory project.
28
28
<TabItem value="console">
29
29
```
30
30
31
- ** Enable and configure account recovery**
31
+ ### Enable and configure account recovery
32
32
33
33
1 . Log in to your [ Ory Console] ( https://console.ory.sh/ )
34
34
2 . Select your workspace and project
@@ -42,11 +42,21 @@ configure account recovery in your Ory project.
42
42
</BrowserWindow>
43
43
```
44
44
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
46
56
47
57
You can choose between the following recovery strategies:
48
58
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)
50
60
- Magic link: Sends a recovery link via email
51
61
52
62
1 . In the Account recovery section
@@ -68,7 +78,7 @@ import BrowserWindow from "@site/src/theme/BrowserWindow"
68
78
<TabItem value="cli">
69
79
```
70
80
71
- ** Download your current configuration**
81
+ ### Download your current configuration
72
82
73
83
First, get your current identity configuration:
74
84
@@ -81,9 +91,14 @@ ory list projects --workspace <workspace-id>
81
91
82
92
# Get the configuration
83
93
ory 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'
84
99
```
85
100
86
- ** Edit recovery configuration**
101
+ ### Edit recovery configuration
87
102
88
103
Add or modify the recovery section in your configuration file:
89
104
@@ -102,7 +117,7 @@ selfservice:
102
117
notify_unknown_recipients : false # Define if the system sends automated recovery notifications to unknown email addresses.
103
118
` ` `
104
119
105
- ** Update your configuration**
120
+ ### Update your configuration
106
121
107
122
After editing, update your configuration:
108
123
@@ -135,9 +150,43 @@ When a user initiates account recovery:
135
150
136
151
### User flow
137
152
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
+
138
165
1 . They enter their email address on the recovery page
139
166
2 . They receive either:
140
167
- A recovery link via email if using the ` link ` method
141
168
- A one-time code via email if using the ` code ` method
142
169
3 . After clicking the link or entering the code, they're prompted to set a new password
143
170
4 . 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