adventurous-addition-28416
07/22/2023, 3:02 AMchilly-king-10285
07/22/2023, 3:02 AMchilly-king-10285
07/22/2023, 3:03 AMjson identity: default_schema_id: admin_v1 schemas: - id: admin_v0 url: base64://{b46-encoded-admin_v0} - id: admin_v1 url: base64://{b46-encoded-admin_v1}
In this configuration, existing identities continue to use the admin_v0
identity schema, and all newly created identities will use admin_v1
schema. When you're ready to migrate all identities that use the admin_v0
to the admin_v1
schema, use the REST API to list all identities using the old version and perform the required data transformations. Sources: - [Manage Identity Schema](https://www.ory.sh/docs/identities/model/manage-identity-schema) - [Identity Schema Best Practices](https://www.ory.sh/docs/kratos/manage-identities/best-practices) - [Manage Ory Network Configuration in Git](https://www.ory.sh/docs/guides/gitops) - [Ory CLI Update Identity Config](https://www.ory.sh/docs/cli/ory-update-identity-config)adventurous-addition-28416
07/22/2023, 3:12 AMadventurous-addition-28416
07/22/2023, 3:12 AMchilly-king-10285
07/22/2023, 3:12 AMchilly-king-10285
07/22/2023, 3:13 AMadventurous-addition-28416
07/22/2023, 3:13 AMadventurous-addition-28416
07/22/2023, 3:14 AMchilly-king-10285
07/22/2023, 3:14 AMchilly-king-10285
07/22/2023, 3:14 AMschema_id
associated with that identity. This schema_id
is set when the identity is created and corresponds to the identity schema used. In your application's business logic, you can use a switch statement to handle different types of identities based on their schema_id
. Here's an example: javascript // This is an example program that can deal with different types of identities session, err := ory.SessionFromRequest(r) // some error handling switch (session.Identity.SchemaID) { case "customer": // ... case "admin": // ... case "default": fallthrough default: // ... }
In this example, if the schema_id
of an identity is "admin", the corresponding case in the switch statement will be executed. Remember, the schema_id
is a unique identifier for each identity schema, and it's used to distinguish between different types of identities in your system. Source: [Managing Users Identities Metadata](https://www.ory.sh/docs/kratos/manage-identities/managing-users-identities-metadata)adventurous-addition-28416
07/22/2023, 3:16 AMchilly-king-10285
07/22/2023, 3:16 AMchilly-king-10285
07/22/2023, 3:17 AMschema_id
should be the identifier you set when creating the schema, such as "admin", "user", etc. This could potentially be a bug or an issue with the specific version of Ory you're using. I would recommend reaching out to the Ory community or support for further assistance. They might be able to provide more insight into why you're seeing this behavior. You can also check the Ory documentation for any updates or changes related to identity schemas and their IDs. Sources: - [Managing Users Identities Metadata](https://www.ory.sh/docs/kratos/manage-identities/managing-users-identities-metadata) - [Customize Identity Schema](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema)