<@U04UQ68083H> As I understand it, we could make d...
# ory-copilot
q
@chilly-king-10285 As I understand it, we could make different "types" of users. Can the same identifier be used for a different type? Like a doctor could be a type of user but could also be a patient and we need to identify them separately
c
A message from kapa.ai
Yes, Ory Kratos allows you to define different "types" of users by using different identity schemas. Each identity is associated with a schema that defines its traits and business logic. For example, you could have a schema for doctors and another for patients, each with its own set of required fields and validation rules. This allows you to tailor the user experience and data model for each user type separately [Identity schema](https://www.ory.sh/docs/kratos/manage-identities/identity-schema). However, regarding identifiers (such as email addresses or usernames), Ory Kratos enforces uniqueness per credential type across all identities. This means that if you use an email address as an identifier for login, the same email cannot be used as a login identifier for two different identities, even if they are of different types (schemas). Attempting to do so will result in a conflict error [Credentials](https://www.ory.sh/docs/kratos/concepts/credentials). So, if a doctor and a patient share the same email address and you use email as the unique identifier for login, they cannot have separate identities with that email. If you need to allow the same person to have multiple roles (e.g., both doctor and patient), you would typically model this as a single identity with multiple roles or attributes, rather than separate identities with the same identifier. If you need to distinguish between the same person acting in different roles, consider adding a "role" or "type" trait to the identity and managing permissions or access based on that trait, rather than creating separate identities with the same identifier [Identity metadata & traits](https://www.ory.sh/docs/kratos/manage-identities/managing-users-identities-metadata#traits). In summary: - You can have different user types via different schemas. - The same identifier (e.g., email) cannot be used for multiple identities, regardless of type. - To support multiple roles for the same person, use a single identity with a role/type attribute.