From 7ca97c845d4ee5d89d8601c92e6fde4964c00e8c Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Tue, 4 Jan 2022 15:33:18 +0530 Subject: [PATCH] Initial kratos config files to start a server To start kratos: kratos serve -c kratos.yml --- .../usermgmt/_kratos/identity.schema.json | 48 +++++++++++ components/usermgmt/_kratos/kratos.yml | 79 +++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 components/usermgmt/_kratos/identity.schema.json create mode 100644 components/usermgmt/_kratos/kratos.yml diff --git a/components/usermgmt/_kratos/identity.schema.json b/components/usermgmt/_kratos/identity.schema.json new file mode 100644 index 0000000..6b1e998 --- /dev/null +++ b/components/usermgmt/_kratos/identity.schema.json @@ -0,0 +1,48 @@ +{ + "$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": { + "first_name": { + "title": "First name", + "type": "string", + "pattern": "^.*$" + }, + "last_name": { + "title": "Last name", + "type": "string", + "pattern": "^.*$" + }, + "email": { + "type": "string", + "format": "email", + "title": "E-Mail", + "minLength": 3, + "ory.sh/kratos": { + "credentials": { + "password": { + "identifier": true + } + }, + "verification": { + "via": "email" + }, + "recovery": { + "via": "email" + } + } + } + }, + "required": [ + "first_name", + "last_name", + "email" + ], + "additionalProperties": false + } + } +} diff --git a/components/usermgmt/_kratos/kratos.yml b/components/usermgmt/_kratos/kratos.yml new file mode 100644 index 0000000..72bc8de --- /dev/null +++ b/components/usermgmt/_kratos/kratos.yml @@ -0,0 +1,79 @@ +version: v0.7.1-alpha.1 + +dsn: memory + +serve: + public: + base_url: http://127.0.0.1:4433/ + cors: + enabled: true + admin: + base_url: http://127.0.0.1:4434/ + +selfservice: + default_browser_return_url: http://127.0.0.1:4455/ + whitelisted_return_urls: + - http://127.0.0.1:4455 + + methods: + password: + 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 + + recovery: + enabled: true + ui_url: http://127.0.0.1:4455/recovery + + verification: + enabled: true + ui_url: http://127.0.0.1:4455/verify + after: + default_browser_return_url: http://127.0.0.1:4455/ + + logout: + after: + default_browser_return_url: http://127.0.0.1:4455/auth/login + + login: + ui_url: http://127.0.0.1:4455/auth/login + lifespan: 10m + + registration: + lifespan: 10m + ui_url: http://127.0.0.1:4455/auth/registration + after: + password: + hooks: + - + hook: session + +log: + level: debug + format: text + leak_sensitive_values: true + +secrets: + cookie: + - PLEASE-CHANGE-ME-I-AM-VERY-INSECURE + +hashers: + argon2: + parallelism: 1 + memory: 128MB + iterations: 2 + salt_length: 16 + key_length: 16 + +identity: + default_schema_url: file://identity.schema.json + +courier: + smtp: + connection_uri: smtps://test:test@mailslurper:1025/?skip_ssl_verify=true&legacy_ssl=true