Authentication and authorization
Understand the Identity Service credentials, agent keys, tenants, and roles, let operators sign in with your identity provider, and recover from a lockout.
The Identity Service uses a separate credential for each job: operators manage agent keys through its control API, service planes call its runtime API, and agents present agent keys to service data planes. This page lists each credential, the agent key grants, tenants, and the roles on the control API. It then shows how to let operators sign in with your identity provider (IdP).
Credentials
| Credential | Held by | What it does |
|---|---|---|
| Control token | The operator, in a Kubernetes Secret | The rescue credential. It can do every control operation. |
| Operator access token | An operator who signs in to your IdP | Gives the operator's control roles, from global.iris.auth.roleBindings. |
| Runtime credential | A service data plane, for example memory-dp |
Lets the data plane check agent keys. |
| Internal token | A service control plane and the Identity Service | Lets the Identity Service ask the control plane whether a grant is valid. |
| Agent key | An agent | Gives the agent access to service resources. |
Each credential has one job, so don't use one value for two jobs. The Identity Service doesn't start when two of the control token, the runtime credentials, and the internal tokens have the same value.
The control token is a shared secret, and the audit log can't name a person for it. Keep it for setup and recovery, and let operators sign in with your IdP for daily work.
Agent keys and grants
An agent key looks like iris_<key-id>.<secret>. The Identity Service returns the full key only once, in the response to a create or a rotation, and stores only a SHA-256 hash of it. If you lose a key, rotate it or create a new one.
Each key has one or more grants:
| Grant field | Meaning | Example |
|---|---|---|
product |
The Iris service. | memory |
resourceType |
The type of resource in that service. | mem-store |
resourceId |
One resource. Wildcards aren't accepted. | <store-id> |
actions |
What the key can do with the resource. | ["read", "write"] |
tenant |
The resource's tenant. The Identity Service adds it. | default |
| Service | product |
resourceType |
Actions |
|---|---|---|---|
| Agent Memory | memory |
mem-store |
read; write (includes read); full (includes write) |
| Agent Playbooks | playbook |
playbook |
read; write, publish, and propose (each includes read); full (includes all) |
| Lens | lens |
lens-instance |
ingest and read, independent of each other; full (includes both) |
| Context Gateway | context-gateway |
gateway |
use; full (includes use) |
| Intent Router | intent |
intent-router |
read; write (includes read); full (includes write) |
Before the Identity Service stores a grant, it asks the service's control plane whether the resource exists and the actions are valid. Each service's authentication page explains what its actions allow. To create and manage keys, see Give an agent access with an agent key.
A data plane caches each key check. After you revoke a key, it can keep working for up to runtime.cache.hardTtlSeconds, 300 seconds by default.
Subject grants
Use the /v1/subject-grants routes to grant a verified token subject access to a service resource. The default redis-iris installation accepts no subject grants and gives data planes no permission to look them up. For a data plane configured to use subject grants, allow the grant's product, resource type, and actions in identityService.subjectGrants.allowed. Give the data plane's runtime credential subject-grant-lookup.
Tenants
A tenant is a boundary for keys, grants, and service data, such as one customer or one business unit. A caller in one tenant can't see the keys of another tenant: the Identity Service returns 404 for them.
The Identity Service has no tenant object, and no API creates, lists, or deletes tenants. A tenant is only an ID that each key, grant, and service resource carries.
In a fixed-tenant redis-iris release, global.iris.tenantId sets the tenant in the Identity Service and every service. The tables below apply to that setup. To serve multiple tenants in one release, see Use a tenant claim.
| Task | What to do |
|---|---|
| Create a tenant | Choose the ID before the first install, and set global.iris.tenantId. |
| Change the ID | Not supported. Keys, grants, and service data keep the old ID, and no tool moves them. A new global.iris.tenantId doesn't make the old data available. |
| Remove a tenant | Uninstall its release, and delete its data. There is no tenant object to delete. |
A grant's tenant field works like this:
tenant in the grant |
Result |
|---|---|
| Not set | The Identity Service uses global.iris.tenantId. |
global.iris.tenantId |
Accepted. |
| Another tenant | 400. |
All the grants of one key must have the same tenant.
Roles on the control API
| Caller | How it gets the role | What it can do |
|---|---|---|
| Control token | It holds the token | Every operation. |
suite_admin |
A role binding without product |
Every operation for every service, in its own tenant. |
product_admin |
A role binding with product |
Every operation for that service, in its own tenant. |
operator, viewer |
A role binding with product |
No key operations. These roles apply only in the service. |
| Any other caller with a valid token | None | No key operations. |
The Identity Service also has a deployment_admin role, for installations with more than one tenant. A redis-iris release has one tenant, so it doesn't need this role, and the suite role bindings can't give it.
For each control API request, the Identity Service finds the caller's role like this:
- If the bearer value is the control token, the caller can do every operation, and there are no more checks.
- Otherwise, the Identity Service reads the value as a JSON Web Token (JWT) from your IdP. It checks the issuer, the signature, the audience, and the expiry. If a check fails, it returns
401. - It compares the values of the role claim,
groupsby default, with thegroupof each role binding. Each matching binding gives its role, so an operator can have more than one role. - It checks the roles against the operation and the service. If no role allows the operation, it returns
403.
A caller with a valid token and no role can still read GET /v1/products. GET /v1/api-keys returns 200 with only the keys the caller can manage, so for such a caller the list is empty.
For example, an operator's token has groups: [memory-admins], and the binding {group: memory-admins, role: product_admin, product: agent_memory} matches. The operator can create keys for Agent Memory, and a key for Agent Playbooks returns 403.
Operator sign-in with your identity provider
Operators can call the control API with an access token from your IdP, using OpenID Connect (OIDC). The audit log then names each operator. The control token keeps working.
1. Register Iris in your IdP
- Register the Iris console as a web application.
- Register one API for the whole suite with one audience, for example
api://redis-iris. - Create groups for key administrators, for example
iris-suite-adminsandmemory-admins, and add operators to them.
2. Configure global.iris.auth
Add these values to iris-values.yaml, together with the ui.sso values from the suite install:
global:
iris:
publicURL: https://<console-host>
auth:
oidc:
issuer: https://<idp-host>/<issuer-path>
jwksURI: https://<idp-host>/<jwks-path>
audience: api://redis-iris
roleBindings:
- {group: iris-suite-admins, role: suite_admin}
- {group: memory-admins, role: product_admin, product: agent_memory}
- {group: memory-ops, role: operator, product: agent_memory}
issueris the issuer of the IdP discovery document. If the access tokens'issclaim differs, for example on Active Directory Federation Services (AD FS), setaccessTokenIssuerto that value. The Identity Service compares it with theissclaim exactly.jwksURI, the JSON Web Key Set (JWKS) URI, must usehttps://. The pods must reach it and trust its certificate authority (CA). See TLS, FIPS, and network.- Role bindings read the
groupsclaim by default. SetroleClaimsto read other claims. Agroupmatches without regard to letter case. - The service names in
roleBindingsareagent_memory,playbook,lens,context_gateway, andintent. - On the Identity Service, only
suite_adminandproduct_admincan manage keys. - A binding for a service that isn't enabled has no effect. The chart keeps it, and uses it again when you enable the service.
The console sends the operator's access token to the Identity Service. The chart sets the same audience and issuer in the console and the Identity Service, so they always match.
3. Apply and check
-
Run
helm upgradefor the release. -
Get an access token for an operator from your IdP, and save it in
OPERATOR_TOKEN. -
Create a key for a resource of one of the operator's services, as in Give an agent access with an agent key, with the operator's token. Then delete it:
curl -sS -X POST "$IRIS_IDENTITY_URL/v1/api-keys" \ -H "Authorization: Bearer $OPERATOR_TOKEN" \ -H 'Content-Type: application/json' \ -d '{"name": "sso-check", "grants": [<grant>]}' curl -sS -X DELETE "$IRIS_IDENTITY_URL/v1/api-keys/<key-id>" \ -H "Authorization: Bearer $OPERATOR_TOKEN"
| Status | Meaning |
|---|---|
201 |
The token is valid and a role binding allows the operation. |
401 |
The issuer, audience, or signature is wrong, or the token expired. Compare the token's iss and aud claims with global.iris.auth.oidc. |
403 |
No role binding gives suite_admin, or product_admin for that service, to the operator's groups. |
Don't use GET /v1/api-keys for this check: without a role, it returns 200 with an empty list. Keep the control token for recovery.
Configure a tenant identity provider
Requires self-managed Redis Iris 1.1 or later.
Register an identity provider (IdP) to bind its issuer to one tenant. The service takes the tenant from the record. An issuer already configured directly on a service keeps using that service's settings.
As a deployment admin, send POST /v1/tenants/<tenant>/identity-providers to the Identity Service control API. Set name, the token issuer and audience, and the provider's HTTPS jwksUri. The issuer and key set URL must match the provider's OpenID Connect discovery document exactly.
- Set
roleClaimsto the claims that contain role values. The defaults arerolesandgroups. InroleMappings, map each acceptedclaimValueto an Irisrole. For example, mapmemory-adminstoproduct_adminfor operators who manage resources in the tenant. - Set
userIdClaimto the claim that contains the stable memory owner ID. If you set it, each token must contain a valid string value in that claim. Without this setting, a data-plane token has no owner ID. - To attach group IDs as identity metadata, set
groupsClaimand addgroupMappingsentries withclaimValueandgroupId. Group mappings grant no permissions.
To accept these tokens, enable auth.tenant_identity_providers.enabled in the service configuration. On the control plane, configure auth.tenant_identity_providers.identity_service with a runtime credential that can call identity-provider-resolve. Operators send the IdP token as a bearer token. Their mapped roles apply only to the record's tenant. product_admin is the highest role a tenant record can grant on a product control plane.
For data-plane access, give its Identity Service runtime credential identity-provider-resolve and subject-grant-lookup. Create a subject grant for the token's issuer and sub on each target resource. userIdClaim sets the memory owner identity. The grant lookup still uses sub.
Recover from a lockout
- Your IdP is down, or the role bindings are wrong. Use the control token. It always works.
- The console can't sign in. Switch the console to admin token mode until the IdP works again.
- You don't have the control token Secret. If the chart generated the token (
global.iris.secrets.generate: true), delete the Secret, if it still exists, and runhelm upgrade. The chart generates a new token. If you supplied the Secret, create a new one with a new token yourself. - You lost the metadata Redis. Restore it from your backup. See Back up and restore. Without it, every agent key and grant stops working.