Your own user type
Sign users in against a type you designed in place of the shipped user, and the realm gives it every field sign-in, tokens and groups need.
AvailableAPI
If your organization already has a model of a person, with its own name and attributes, you don’t have to fit it
into the shipped user. Define your own type, point the realm at it, and sign-in, tokens, groups, secrets and agents
all follow it.
Before you begin
Section titled “Before you begin”- Privilege:
RealmOwner. The binding and the type it names are both realm configuration. See Who may do what. - Where: the API, with your session in
$CVYUH_SESSION(see Call the API). - Do it before you add users, in a new realm: users already stored don’t move.
How it works
Section titled “How it works”The realm signs users in against whatever type its identity binding names. By default that’s user, found by
uid, with its password in passwordHash and its groups in memberOf. Point the binding at a type you designed,
such as person, and every part of the realm reads users from it.
When you bind a type, the realm first gives it every attribute and link the shipped type carries, marked as carried, so nothing sign-in or tokens read is missing. An attribute you already gave it under one of those names is kept if its definition matches the shipped one, and the binding is refused if it doesn’t.
| Binding field | What it names | Default |
|---|---|---|
userType | The type users are | user |
groupType | The type groups are | group |
agentType | The type AI agents are | agent |
namingAttr | The attribute users sign in with | uid |
passwordAttr | The attribute holding the password | passwordHash |
membershipAttr | The link from a user to their groups | memberOf |
Set it up
Section titled “Set it up”-
Define your type, as Custom types describes, for example
person. -
Point the binding at it:
Terminal window curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/identityBinding/identityBinding \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "userType": "person" }' -
Read the type back with
GET /types/v1/person: it now carries every shipped attribute beside yours.
When a binding fails
Section titled “When a binding fails”| Answer | Code | What it means | What to do |
|---|---|---|---|
400 | POLICY_VIOLATION | An attribute on your type has a carried name but a different definition | Rename yours, or make its definition match the shipped one |
400 | SCHEMA_VALIDATION_FAILED | The binding body doesn’t read, such as an unknown field | Send only the fields in the table above |
412 | REVISION_CONFLICT | Your type changed while the carried attributes were being added | Send the binding again |
Audit record
Section titled “Audit record”The change to the binding is recorded as PATCHED on identityBinding, and the carried attributes added to your type
as UPDATED on the type, each with before and after.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
| Users can’t sign in after the binding changed | They’re stored as user, which is no longer the bound type | Point the binding back, or create them in the new type |
A save of your type is refused 400, naming an attribute | It’s carried, and only its default and description can change | Leave it as it is |
Good to know
Section titled “Good to know”- Bind before you add users. Users already stored as
userdon’t move to the new type, and once the binding points elsewhere they no longer sign in. - A carried attribute stays. On a bound type, the carried attributes can change only their
defaultanddescription, as on the shippeduser.
Related
Section titled “Related”- Custom types: define the type first.
- The identity model: how the shipped user is built.
- Attributes and validation: carried attributes and their rules.