IV Users and Access

Users and Access Reference

Every resource the gateway serves for users and access, every directive, setting and secret, and every status a client meets, with a link to where each is shown at work.

§Resources

All of these exist in every application. :identity is an identity id. “Self” means credentials of the identity in the path.

§Identity

RequestDoesAccess
GET /identity/Answers who the caller is; without credentials, creates a guest.anyone
POST /identity/Creates an identity for new credentials.no identity yet
GET /identity/credentials/:identity/Lists the ways to sign in.self

§Passwords

RequestDoesAccess
POST /identity/basic/Creates an identity with a username and password.no credentials
GET /identity/basic/usernames/:username/Tells whether a username is taken.no credentials
POST /identity/basic/:identity/Adds a password to an identity.self, system:identity:basic
PATCH /identity/basic/:identity/Changes username or password.same, with Basic only
DELETE /identity/basic/:identity/Removes the password.self, system:identity:basic

§Tokens

RequestDoesAccess
POST /identity/tokens/refresh/Replaces the token with one carrying current roles.any identity, but a custom token
POST /identity/tokens/:identity/Issues a custom token.self, system:identity:tokens
GET /identity/keys/:identity/Lists custom tokens.self, system:identity:keys
DELETE /identity/keys/:identity/:key/Revokes a custom token.self, system:identity:keys

§Providers

RequestDoesAccess
POST /identity/federation/:identity/Adds a provider’s account.self
GET /identity/federation/:identity/Lists them.self
DELETE /identity/federation/:identity/:credential/Removes one.self

§Codes and passkeys

RequestDoesAccess
POST /identity/otp/:identity/Issues a code for the identity.self, system:identity:otp
PUT /identity/otp/:identity/Ties an address to the identity with the code issued for it.self
POST /identity/passkeys/challenges/Creates a challenge; with type: creation, a new identity too.no credentials
POST /identity/passkeys/challenges/:identity/Creates a challenge for a known identity.no credentials
POST /identity/passkeys/Signs in with a passkey.no credentials
POST /identity/passkeys/:identity/Stores a passkey.self
GET /identity/passkeys/:identity/Lists passkeys.self
DELETE /identity/passkeys/:identity/:passkey/Removes one.self

§Roles and bans

RequestDoesAccess
GET /identity/roles/:identity/Lists roles.self, system:identity:roles
POST /identity/roles/:identity/Grants a role.system:identity:roles, system:identity:roles:delegation
DELETE /identity/roles/:identity/:role/Revokes a role.system:identity:roles
PUT /identity/bans/:identity/Bans or unbans.system:identity:bans

§Other applications

Served only with the oauth annotation.

RequestDoesAccess
GET /.well-known/oauth-authorization-serverServer metadata. Also at /.well-known/openid-configuration.public
GET /.well-known/oauth-protected-resource[/path]Protected resource metadata.public
POST /identity/clients/Registers a client.no credentials
GET /identity/clients/:client/Describes a client.any identity
POST /identity/grants/:identity/Issues an authorization code.self
POST /identity/grants/Exchanges a code for a token.no credentials
GET /identity/grants/:identity/Lists grants.self
DELETE /identity/grants/:identity/:grant/Revokes a grant.self

Routes marked “no credentials” refuse a request that carries valid ones with 403; see auth:anonymous.

§Operations an application calls

CallUse
context.remote.identity.otp.issue({ input: { authority, username, identity, lifetime } })Get a sign-in code to deliver to the user.

§Directives

The auth family is listed in Restrict Who Can Call a Route. Directives of other families used with it:

DirectiveUse
map:authorityThe authority of the request as an input property.
map:claimsClaims of a provider’s token as input properties.
map:segmentsA route variable as an input property.
require:header, require:headersHeaders a request must carry.

§Context annotation

Keys of exposition in context.toa.yaml that concern users and access. The other keys are in Run and Configure the Gateway.

KeyValueDefaultSee
authoritiesMap of name to host. Required.Domains
ipHeader that holds the client address.noneThe client address
bouncer.attemptsFailed sign-ins an address may make in a row.20Limit password guessing
bouncer.intervalSeconds in which they are earned back.60
countryHeader that holds the client’s country.noneRefuse by country
censorCountries answered 451.
oauth.authorizeURL of the consent page. Required within oauth.Other applications
oauth.resourcesPaths advertised as protected resources.none
oauth.scopesScopes advertised.none
oauth.registrationopen or closed.closed

§Configuration

Set under configuration in context.toa.yaml, keyed by component.

ComponentKeyDefaultSee
identity.tokenskeysrequiredKeys
lifetime2592000 sHow long a sign-in lasts
refresh600 s
cache.max, cache.ttl1024, 600000 msCustom tokens
identity.basicusername, password^.{1,128}$, ^.{8,32}$Rules
rounds10How passwords are stored
peppernone
principalnoneThe first administrator
identity.federationtrust[]Providers
asserttrue
principalnone
identity.otplifetime300 sLimits
attempts5
identity.passkeysalgorithms, timeout, residence, verification[-7, -257], 60000 ms, required, noneSettings
identity.grantslifetime, token60 s, 2592000 sSettings
identity.clientstrust, lifetime, ttl, size, timeout[], 3600 s, 2592000 s, 16384, 3000 ms

§Secrets

Values that must not be written into the Context. Each is given as a $NAME reference and provided separately, as Configuration and Secrets describe.

SettingWhat it is
identity.tokens.keys[].keyToken key, generated with toa key. At least one is required.
identity.basic.pepperPassword hashing pepper.
identity.federation.trust[].secretA provider’s client secret.
identity.federation.trust[].signature.keyA provider’s private key for client assertions, PKCS8 PEM.
# context.toa.yaml
configuration:
  identity.tokens:
    keys:
      - id: 2026q4
        key: $IDENTITY_TOKENS_KEY
  identity.basic:
    pepper: $IDENTITY_BASIC_PEPPER
    principal:
      authority: local
      username: root
  identity.federation:
    trust:
      - iss: https://accounts.google.com
        aud: 1045282659797-example.apps.googleusercontent.com
        secret: $GOOGLE_CLIENT_SECRET

§Statuses

What a client of the application has to handle.

StatusMeaningWhat to do
401 UnauthorizedThe request has no identity and the route needs one: no credentials, or credentials that are wrong, expired, revoked, banned, from another authority, or of an unknown scheme. Also a token of another application used outside its resource.Sign in again.
403 ForbiddenThe identity is known and not admitted: no directive admits it, a custom token’s permissions exclude the request, the wrong scheme for an auth:scheme route, an unauthorized input property, credentials sent to an anonymous route, or a sign-up with credentials that already have an identity.Do not retry as is.
422 Unprocessable EntityRefused with a code: INVALID_USERNAME, INVALID_PASSWORD, INVALID_CREDENTIALS, EXISTS, PRINCIPAL_LOCKED, INACCESSIBLE_SCOPE, UNKNOWN_CLIENT, FAILED, INVALID, MISS, or a provider code.Read code.
409 ConflictThe username is taken.Choose another.
429 Too Many RequestsToo many failed sign-ins from this address, or a throttled endpoint.Wait retry-after seconds.
451 Unavailable For Legal ReasonsThe request matched censor.Nothing.
400 Bad RequestA malformed host, a missing required header, a body that is not an object where auth:delegate applies, or an OAuth error with error and error_description.Fix the request.

The body of a 401 or 403 does not say which reason applied, beyond the two texts quoted in Restrict Who Can Call a Route. The reason for rejected credentials is in the gateway’s log.

Alongside every successful status: a response may carry an authorization header, and the client must switch to the token in it.

The reasoning behind identities, tokens and access on routes is in the model.

Search
Search the documentation