hundreds-match-36539
01/17/2024, 11:08 AMchilly-king-10285
01/17/2024, 11:08 AMchilly-king-10285
01/17/2024, 11:08 AMbash # Encode your schema to Base64 and export it to a variable. schema=$(cat {path-to-json-with-identity-schema} | base64) # Update your project's configuration. ory patch identity-config {your-project-id} \ --replace '/identity/default_schema_id="{unique-schema-id}"' \ --replace '/identity/schemas=[{"id":"{unique-schema-id}","url":"base64://'$schema'"}]'
3. Version the Identity Schema: It can be useful to version the Identity Schema. This is especially helpful if you use custom Identity Schemas as it helps to keep track of changes. You can copy the Identity Schema directly from the Ory Network console or get it from the config file you pulled earlier[^2^]. 4. Use Multiple Identifiers: You can have multiple identifiers in your identity schema. For example, you could have a username and an email address that the user can use to sign in[^5^]. 5. Update Identity Schemas: To update an identity schema, you must create a new revision of that schema. You can't update existing identity schemas by editing them[^4^]. 6. Update Identities to Use a New Schema: Updating the identity schema of a project can result in inconsistencies between the new schema and the identities created with the old schema. You can patch identities after updating the identity schema[^6^]. Remember, depending on your setup, you can benefit from defining different identity schemas for different groups of users, such as customer support and end users[^1^]. [^1^]: [Manage Identities - Identity Schema](https://www.ory.sh/docs/kratos/manage-identities/identity-schema) [^2^]: [Manage Ory Network Configuration in Git - Identity Schema](https://www.ory.sh/docs/guides/gitops#identity-schema) [^4^]: [Update Identity Schemas](https://www.ory.sh/docs/identities/model/manage-identity-schema#update-identity-schemas) [^5^]: [Multiple Identifiers](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#multiple-identifiers) [^6^]: [Update Identities to Use a New Schema](https://www.ory.sh/docs/identities/model/manage-identity-schema#update-identities-to-use-a-new-schema)hundreds-match-36539
01/17/2024, 11:22 AMhundreds-match-36539
01/17/2024, 11:23 AMchilly-king-10285
01/17/2024, 11:23 AMchilly-king-10285
01/17/2024, 11:24 AMbash # Encode your schema to Base64 and export it to a variable. schema=$(cat {{path-to-json-with-identity-schema}} | base64) # Update your project's configuration. ory patch identity-config {{your-project-id}} \ --replace '/identity/default_schema_id="{{unique-schema-id}}"' \ --replace '/identity/schemas=[{{"id":"{{unique-schema-id}}","url":"base64://'$schema'"}}]'
3. Repeat the Process for Each User Group: Repeat the process for each user group, creating a unique identity schema tailored to the specific needs and requirements of each group[^1^]. 4. Assign the Identity Schemas: Assign the created identity schemas to the respective user groups. This process will depend on your specific setup and user management system. Remember, the identity schema not only defines the data model of your identities, but also controls business logic and allows you to define which field is used as the identifier when logging in and which fields are used to verify or recover the user's identity[^1^]. [^1^]: [Manage Identities - Identity Schema](https://www.ory.sh/docs/kratos/manage-identities/identity-schema)