-
Notifications
You must be signed in to change notification settings - Fork 974
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sms verification for phone numbers
- Loading branch information
1 parent
7c0e02e
commit f0c9554
Showing
58 changed files
with
880 additions
and
664 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
contrib/quickstart/kratos/phone-password/identity.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$id": "https://schemas.ory.sh/presets/kratos/quickstart/email-password/identity.schema.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Person", | ||
"type": "object", | ||
"properties": { | ||
"traits": { | ||
"type": "object", | ||
"properties": { | ||
"phone": { | ||
"type": "string", | ||
"format": "tel", | ||
"title": "Phone number", | ||
"minLength": 3, | ||
"ory.sh/kratos": { | ||
"credentials": { | ||
"password": { | ||
"identifier": true | ||
} | ||
}, | ||
"verification": { | ||
"via": "phone" | ||
} | ||
} | ||
} | ||
}, | ||
"required": ["phone"], | ||
"additionalProperties": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
version: v0.13.0 | ||
|
||
dsn: memory | ||
|
||
serve: | ||
public: | ||
base_url: http://127.0.0.1:4433/ | ||
cors: | ||
enabled: true | ||
admin: | ||
base_url: http://kratos:4434/ | ||
|
||
selfservice: | ||
default_browser_return_url: http://127.0.0.1:4455/ | ||
allowed_return_urls: | ||
- http://127.0.0.1:4455 | ||
- http://localhost:19006/Callback | ||
- exp://localhost:8081/--/Callback | ||
|
||
methods: | ||
password: | ||
enabled: true | ||
totp: | ||
config: | ||
issuer: Kratos | ||
enabled: true | ||
lookup_secret: | ||
enabled: true | ||
link: | ||
enabled: true | ||
code: | ||
enabled: true | ||
|
||
flows: | ||
error: | ||
ui_url: http://127.0.0.1:4455/error | ||
|
||
settings: | ||
ui_url: http://127.0.0.1:4455/settings | ||
privileged_session_max_age: 15m | ||
required_aal: highest_available | ||
|
||
recovery: | ||
enabled: true | ||
ui_url: http://127.0.0.1:4455/recovery | ||
use: code | ||
|
||
verification: | ||
enabled: true | ||
ui_url: http://127.0.0.1:4455/verification | ||
use: code | ||
after: | ||
default_browser_return_url: http://127.0.0.1:4455/ | ||
|
||
logout: | ||
after: | ||
default_browser_return_url: http://127.0.0.1:4455/login | ||
|
||
login: | ||
ui_url: http://127.0.0.1:4455/login | ||
lifespan: 10m | ||
|
||
registration: | ||
lifespan: 10m | ||
ui_url: http://127.0.0.1:4455/registration | ||
after: | ||
password: | ||
hooks: | ||
- hook: session | ||
- hook: show_verification_ui | ||
|
||
log: | ||
level: debug | ||
format: text | ||
leak_sensitive_values: true | ||
|
||
secrets: | ||
cookie: | ||
- PLEASE-CHANGE-ME-I-AM-VERY-INSECURE | ||
cipher: | ||
- 32-LONG-SECRET-NOT-SECURE-AT-ALL | ||
|
||
ciphers: | ||
algorithm: xchacha20-poly1305 | ||
|
||
hashers: | ||
algorithm: bcrypt | ||
bcrypt: | ||
cost: 8 | ||
|
||
identity: | ||
default_schema_id: default | ||
schemas: | ||
- id: default | ||
url: file:///etc/config/kratos/identity.schema.json | ||
|
||
courier: | ||
channels: | ||
- id: phone | ||
request_config: | ||
url: https://api.twilio.com/2010-04-01/Accounts/AXXXXXXXXXXXXXX/Messages.json | ||
method: POST | ||
body: base64://ZnVuY3Rpb24oY3R4KSB7CkJvZHk6IGN0eC5ib2R5LApUbzogY3R4LnRvLEZyb206IGN0eC5mcm9tCn0= | ||
headers: | ||
Content-Type: application/x-www-form-urlencoded | ||
auth: | ||
type: basic_auth | ||
config: | ||
user: AXXXXXXX | ||
password: XXXX | ||
|
||
feature_flags: | ||
use_continue_with_transitions: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package courier | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
type Channel interface { | ||
ID() string | ||
Dispatch(ctx context.Context, msg Message) error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.