great-laptop-90610
07/10/2024, 3:01 PMchilly-king-10285
07/10/2024, 3:01 PMchilly-king-10285
07/10/2024, 3:01 PMpasskey.display_name
field, the webauthn.identifier
will be used as a fallback. If neither is defined, the passkey strategy will not work. Here is an example of a minimum viable identity schema with a passkey display name: json { "$schema": "<http://json-schema.org/draft-07/schema#>", "type": "object", "properties": { "traits": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "title": "Your E-Mail", "minLength": 3, "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "passkey": { "display_name": true, }, }, }, }, }, }, }, }
In this example, the email
field is used as the display name for the passkey. You can replace email
with any other field you want to use as the display name. Please note that this is a minimum viable schema and you might need to add more fields depending on your application's requirements. For more information, you can refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/passwordless/passkeys#identity-schema).great-laptop-90610
07/10/2024, 3:27 PMidentifier
instead of the email
. I can even have multiple users with the same email. What do I need to do to make the identifier unique?chilly-king-10285
07/10/2024, 3:27 PMchilly-king-10285
07/10/2024, 3:27 PM"identifier": true
to the <http://ory.sh/kratos|ory.sh/kratos>
section of the email field in your schema. Here is an example of how to do this: json { "$schema": "<http://json-schema.org/draft-07/schema#>", "type": "object", "properties": { "traits": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "password": { "identifier": true } } } } }, "additionalProperties": false } } }
In this schema, the email
field is marked as an identifier. This means that Ory Kratos will ensure that each user has a unique email. For more information, you can refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/concepts/credentials/username-email-password#custom-identity-schema).great-laptop-90610
07/10/2024, 3:28 PMpassword
method, only passkey.great-laptop-90610
07/10/2024, 3:28 PMpassword
method, only passkey.chilly-king-10285
07/10/2024, 3:28 PMchilly-king-10285
07/10/2024, 3:28 PMjson { "$schema": "<http://json-schema.org/draft-07/schema#>", "type": "object", "properties": { "traits": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "title": "Your E-Mail", "minLength": 3, "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "passkey": { "display_name": true, }, }, }, }, }, }, }, }
For more detailed information on how to enforce uniqueness of the email field for the passkey method, I would recommend checking the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/) or reaching out to the Ory community for support.