1
1
---
2
2
id : verify-email-account-activation
3
- title : Verify email addresses associated with users accounts
4
- sidebar_label : Email address verification
3
+ title : Verify addresses associated with users accounts
4
+ sidebar_label : Address verification
5
5
---
6
6
7
- # Email address verification
7
+ # Address verification
8
8
9
9
``` mdx-code-block
10
10
import CodeTabs from "@theme/Code/CodeTabs"
@@ -14,9 +14,9 @@ import TabItem from "@theme/TabItem"
14
14
import RenderFlow from "@theme/Code/RenderFlow"
15
15
```
16
16
17
- Ory allows users to verify email addresses associated with their accounts. This is important to prove that the user has access to
18
- the address they used to create their account. If verification is enabled, Ory Identities starts the verification process
19
- automatically when users sign up. Users can also verify their addresses manually.
17
+ Ory allows users to verify email addresses or phone numbers associated with their accounts. This is important to prove that the
18
+ user has access to the address they used to create their account. If verification is enabled, Ory Identities starts the
19
+ verification process automatically when users sign up. Users can also verify their addresses manually.
20
20
21
21
The verification flow is supported in both browsers and API clients and can be summarized as the following state machine:
22
22
@@ -49,7 +49,8 @@ stateDiagram
49
49
:::caution
50
50
51
51
Completing account verification doesn't guarantee that the account is used by the person who performed the verification. We
52
- recommend implementing additional security mechanisms to ensure that verified accounts aren't taken over by malicious actors.
52
+ recommend implementing additional security mechanisms to ensure that verified accounts aren't taken over by malicious actors, such
53
+ as [ TOTP] ( ../../mfa/15_totp.mdx ) or [ FIDO2/WebAuthn] ( ../../mfa/20_webauthn-fido-yubikey.mdx ) .
53
54
54
55
:::
55
56
@@ -63,6 +64,13 @@ recommend implementing additional security mechanisms to ensure that verified ac
63
64
To configure account verification, go to ** Authentication** → ** Email Verification** in the
64
65
[ Ory Console] ( https://console.ory.sh/projects/current/verification ) .
65
66
67
+ :::caution
68
+
69
+ For SMS verification to work, you'll also need to configure a ` courier_channel ` with the ID set to ` sms ` via the CLI. See the
70
+ ** Ory CLI** tab for more information.
71
+
72
+ :::
73
+
66
74
``` mdx-code-block
67
75
</TabItem>
68
76
<TabItem value="cli" label="Ory CLI">
@@ -143,7 +151,7 @@ provides when registering their account. Other fields inside the `traits` sectio
143
151
+ }
144
152
}
145
153
}
146
- }
154
+ },
147
155
"additionalProperties": false
148
156
}
149
157
}
@@ -274,7 +282,7 @@ For more information see the [hooks configuration](../../hooks/01_configure-hook
274
282
### Carry over verified status from Social Sign-In
275
283
276
284
Some Social Sign-In providers like Google return the verified status of the email address. To carry over the verified status from
277
- the Social Sign-In provider, return ` verified_addresses ` in your Social Sign-In JsonNet snippet:
285
+ the Social Sign-In provider, return ` verified_addresses ` in your Social Sign-In Jsonnet snippet:
278
286
279
287
``` jsonnet
280
288
local claims = {
@@ -329,6 +337,57 @@ email.
329
337
330
338
If the verified address is not present in the identity's traits, the verified status is not carried over.
331
339
340
+ ## Phone number verification
341
+
342
+ To send SMS messages, you need to have a trait in your identity schema that holds the phone number. The trait must be marked as a
343
+ verifiable address via the ` verification ` extension. Here's an example of how to define such a trait in the identity schema:
344
+
345
+ ``` json
346
+ {
347
+ "$id" : " https://schemas.ory.sh/presets/kratos/quickstart/phone-password/identity.schema.json" ,
348
+ "$schema" : " http://json-schema.org/draft-07/schema#" ,
349
+ "title" : " Person" ,
350
+ "type" : " object" ,
351
+ "properties" : {
352
+ "traits" : {
353
+ "type" : " object" ,
354
+ "properties" : {
355
+ "email" : {
356
+ "type" : " string" ,
357
+ "title" : " E-Mail" ,
358
+ "format" : " email" ,
359
+ "ory.sh/kratos" : {
360
+ "credentials" : {
361
+ "password" : {
362
+ "identifier" : true
363
+ }
364
+ },
365
+ "verification" : {
366
+ "via" : " email"
367
+ }
368
+ }
369
+ },
370
+ "phone" : {
371
+ "type" : " string" ,
372
+ "title" : " Phone number" ,
373
+ "format" : " tel" ,
374
+ "ory.sh/kratos" : {
375
+ // highlight-start
376
+ "verification" : {
377
+ "via" : " sms"
378
+ }
379
+ // highlight-end
380
+ }
381
+ }
382
+ },
383
+ "additionalProperties" : false
384
+ }
385
+ }
386
+ }
387
+ ```
388
+
389
+ Make sure to configure an SMS channel in the Ory configuration. See the [ SMS documentation] ( ../../emails-sms/10_sending-sms.mdx ) .
390
+
332
391
## Choosing the right strategy
333
392
334
393
Ory supports two strategies for verifying your user's addresses.
0 commit comments