Does anyone know how I can associate an identity s...
# talk-kratos
m
Does anyone know how I can associate an identity schema with an OIDC provider? For example, my config looks like this:
Copy code
selfservice:
  methods:
    oidc:
      config:
        providers:
          - id: okta-test
            provider: generic
            client_id: "id"
            client_secret: "secret"
            issuer_url: <https://login.example.com>
            mapper_url: <base64://bG9jYWwgY2xhaW1zID0gc3RkLmV4dFZhcignY2xhaW1zJyk7Cgp7CiAgaWRlbnR>pdHk6IHsKICAgIHNjaGVtYV9pZDogImFkbWluLXVzZXIiLAogICAgdHJhaXRzOiB7CiAgICAgIGVtYWlsOiBjbGFpbXMuZW1haWwsCiAgICB9LAogIH0sCn0K
            scope:
            - openid
            - profile
            - email
identity:
  default_schema_id: user
  schemas:
    - id: user
      url: file:///etc/config/kratos/user-schema.json
    - id: admin-user
      url: file:///etc/config/kratos/admin-user-schema.json
where I want my
okta-test
provider to use the
admin-user
schema, instead of the default
user
schema. How can I specify that?
Perhaps I'm missing something, but here's my use case: When someone logs in through my
okta-test
provider, I want the Kratos identity to be validated and created using the
admin-user
schema. Currently,
user
is set as the
default_schema_id
, so it's using that. But I want to use
admin-user
instead. How can I make that happen?
b
In such a situation, I created a second instance of Kratos, which has a different schema on selfservice, but there may be another solution
m
Hmm a separate instance to support another schema seems a bit heavy-handed, no? Does it have a separate DB too? If we can't specify a schema for a given login method, then what's the point of supporting multiple schemas? (note that I'm still new to Kratos, so it's possible that I'm misunderstanding something)
b
We had the same database. Our env is deployed on k8s, so second instance wasn't any problem
m
That sounds reasonable - maybe this is the way to handle my use case... It'd be helpful to find an official source (or Ory rep 🙂) to confirm this approach 🤞