Identities
Create accounts for the people who build and operate your backend, give them policies, and log them in to the panel and the API.
Identities are accounts for your team: developers, content editors, support staff and operators. They log in to the panel, and their tokens can call every management API their policies allow.

The default identity
Every instance starts with one identity that has full access:
| Setting | API option | Default |
|---|---|---|
| Identifier | --passport-default-identity-identifier | spica |
| Password | --passport-default-identity-password | spica |
| Policies | --passport-default-identity-policies | All *FullAccess policies |
Log in
/passport/identifycurl -X POST https://api.example.com/api/passport/identify \
-H "Content-Type: application/json" \
-d '{"identifier": "spica", "password": "spica", "expires": 3600}'{"scheme": "IDENTITY", "token": "eyJhbGciOiJIUzI1NiIs...", "issuer": "passport/identity"}| Field | Description |
|---|---|
identifier, password | Credentials. |
expires | Optional token lifetime in seconds, up to the server's limit. See Tokens. |
Use the token as Authorization: IDENTITY <token>. The response also sets a refresh token cookie, see Tokens & sessions.
Wrong credentials return 401 with Identifier or password was incorrect. When the identity has two-factor authentication, the response is a challenge instead of a token.
Manage identities
| Endpoint | Action |
|---|---|
GET /passport/identity | passport:identity:index |
GET /passport/identity/:id | passport:identity:show |
POST /passport/identity | passport:identity:create |
PUT /passport/identity/:id | passport:identity:update |
DELETE /passport/identity/:id | passport:identity:delete |
PUT /passport/identity/:id/policy/:policyId | passport:identity:policy:add |
DELETE /passport/identity/:id/policy/:policyId | passport:identity:policy:remove |
Create an identity, then attach policies to it:
curl -X POST https://api.example.com/api/passport/identity \
-H "Authorization: IDENTITY <token>" -H "Content-Type: application/json" \
-d '{"identifier": "editor", "password": "a-long-random-password"}'
curl -X PUT https://api.example.com/api/passport/identity/<identityId>/policy/BucketFullAccess \
-H "Authorization: IDENTITY <token>"{"identifier": "editor", "policies": [], "_id": "6b0b1b36a5611972c29c2643"}New identities have no policies. They can log in, but every API call returns 403 until you attach some.
Typical roles
| Role | Policies |
|---|---|
| Developer | The *FullAccess policies of the modules they work on. |
| Content editor | A custom policy with the data actions of the content buckets, plus StorageFullAccess for images. |
| Support | UserReadOnlyAccess, ActivityReadOnlyAccess and read-only data access. |
| Auditor | The *ReadOnlyAccess policies. |
Profile and permissions of the current identity
| Endpoint | Returns |
|---|---|
GET /passport/identity/verify | The decoded token. Send the raw token in Authorization, without the scheme. |
GET /passport/identity/statements | Every policy statement that applies to the caller. |
Limits and settings
| API option | Effect |
|---|---|
--passport-identity-limit | Maximum number of identities. |
--passport-identity-token-expires-in | Default token lifetime, 2 days. |
--passport-identity-token-expiration-seconds-limit | Longest lifetime a client can request with expires. |
--passport-identity-password-history-limit | Previous passwords that can't be reused. |
--passport-identity-failed-login-attempt-limit, --passport-identity-block-duration-after-failed-login-attempts | Lockout after failed logins. |
Password rules such as minimum length are set in the identity configuration.