Identity Schema, Custom Fields
The Identity Schema is a JSON Schema which describes your identity's (your customers / users / employees ...) fields. In Ory, every identity can have their own model, allowing you to separate between different customer types, user types (employees and customers). For technical information on Identity Schemas, check out the open source documentation:
The Identity Schema can either be one of the available presets or a customized model.
Available Presets​
Ory Cloud provides three basic Identity Schema Presets.
Username & Password​
This preset is useful for applications that don't require email addresses and a high degree of anonymity.
note
This preset disables account verification, account recovery, and account enumeration defenses! Don't use it in security-sensitive environments.
With this preset, every identity has just one trait - the username
. The
username
is the login identifier:
// Identity example
{
id: '6e9d3d30-f93e-4630-901f-c2096953723d',
traits: {
username: 'some-username'
}
}
Email & Password​
With this preset, identities have just one trait, the email
. The email
is
the login identifier, for email verification, and for account recovery:
// Identity example
{
id: '6e9d3d30-f93e-4630-901f-c2096953723d',
traits: {
email: 'foo@bar.com'
}
}
Demo Profile​
warning
This profile is EXPERIMENTAL and you should it for PoCs and demos.
The Demo Profile preset has - like the Email & Password preset - an email field, a first name, last name, and a checkbox.
// Identity example
{
id: '6e9d3d30-f93e-4630-901f-c2096953723d',
traits: {
email: 'foo@bar.com',
name: {
first: 'Foo',
last: 'Bar'
},
newsletter: true
}
}
Custom Identity Schema​
Ory gives you the option to add custom fields to your Identity Schema.
You can define new traits for an identity, save the identity as a template and switch between different Identity Schemas.
For a hands-on guide on how to create a custom Identity Schema, please head over to this document: Customize Identity Schema Guide.