I'm submitting registration form and I'm getting `...
# talk-kratos
j
I'm submitting registration form and I'm getting
msg=Encountered self-service flow error. audience=audit error=map[message:I[#/] S[] could not find a strategy to sign up with trace:
Any ideas?
m
How are you running Kratos?
j
I run it in docker, that's the config:
Copy code
version: v0.8.2-alpha.1

dsn: <postgres://kratos:kratos@localhost:6543/kratos?sslmode=disable&max_conns=20&max_idle_conns=4>

dev: true
serve:
  public:
    base_url: <http://localhost:4433>
    domain_aliases:
      - match_domain: localhost
        base_path: /
        scheme: http
    cors:
      debug: true
      enabled: true
      allowed_origins:
        - <http://localhost>
        - <http://localhost:3001/*>
        - <http://localhost:3001>
      allow_credentials: true
      allowed_methods:
        - POST
        - OPTIONS
        - GET
        - PUT
        - PATCH
        - DELETE
      allowed_headers:
        - Authorization
        - Cookie
        - Content-Type
      exposed_headers:
        - Content-Type
        - Set-Cookie
  admin:
    base_url: <http://localhost:4434>

selfservice:
  default_browser_return_url: <http://localhost:3001>
  whitelisted_return_urls:
    - <http://localhost:3001>

  methods:
    password:
      config:
        haveibeenpwned_enabled: false
      enabled: true

  flows:
    error:
      ui_url: <http://localhost:3001/error>

    settings:
      ui_url: <http://localhost:3001/settings>
      privileged_session_max_age: 15m

    recovery:
      enabled: true
      ui_url: <http://localhost:3001/recovery>

    verification:
      enabled: true
      ui_url: <http://localhost:3001/verification>
      after:
        default_browser_return_url: <http://localhost:3001/>

    logout:
      after:
        default_browser_return_url: <http://localhost:3001/login>

    login:
      ui_url: <http://localhost:3001/login>
      lifespan: 10m

    registration:
      lifespan: 10m
      ui_url: <http://localhost:3001/register>
      after:
        password:
          hooks:
            - hook: session
            # - hook: web_hook
            #   config:
            #     url: <http://localhost:5556/private/registration/before>
            #     method: POST
            #     body: file:///etc/config/kratos/register.jsonnet
            # auth:
            #   type: basic_auth
            #   config:
            #     user: kratos
            #     password: password
log:
  level: trace
  format: text
  leak_sensitive_values: true

cookies:
  domain: <http://localhost>

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_url: file:///etc/config/kratos/identity.schema.json

courier:
  smtp:
    connection_uri: <smtps://test:test@localhost:2500/?skip_ssl_verify=true>


session:
  lifespan: 24h
  cookie:
    name: 'test_session'
    persistent: true
s
I suspect you are missing the identifier declaration in the identity schema, can you check that?
j
Identity schema:
Copy code
{
  "$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": {
        "email": {
          "type": "string",
          "format": "email",
          "title": "E-Mail",
          "minLength": 3,
          "<http://ory.sh/kratos|ory.sh/kratos>": {
            "credentials": {
              "password": {
                "identifier": true
              }
            },
            "verification": {
              "via": "email"
            },
            "recovery": {
              "via": "email"
            }
          }
        },
        "name": {
          "type": "object",
          "properties": {
            "first": {
              "title": "First Name",
              "type": "string"
            },
            "last": {
              "title": "Last Name",
              "type": "string"
            }
          }
        }
      },
      "required": [
        "email"
      ],
      "additionalProperties": false
    }
  }
}
s
Hm ok that looks fine
j
Thank you for checking - the problem was that I didn't put the "password" in the serialized data
s
Ah well that is indeed required 😂