Px/

Identity Providers

Register OIDC identity providers per tenant so the service can validate JWTs issued by any standards-compliant IdP.

Edit this page on GitHub

Permix uses provider-agnostic JWKS resolution. Any OIDC-compliant identity provider — Keycloak, Auth0, Okta, Cognito, or your own — can be registered as long as it exposes a JWKS endpoint.

Supported token formats#

FeatureSupport
RS256 (RSA) JWTs
ES256 (EC) JWTs
Per-issuer JWKS caching
Configurable claim mapping
One active IdP per tenant

Registering an IdP#

See Tenant Management for the full /admin/tenants/{id}/identity-providers API. A minimal registration payload:

json
{
  "issuer_url": "https://your-idp.example.com/realms/myrealm",
  "jwks_uri": "https://your-idp.example.com/realms/myrealm/protocol/openid-connect/certs",
  "claim_config": {
    "roles_claim": "realm_access.roles",
    "domain_claim": "dom",
    "admin_domain_claim": "adm"
  }
}

Claim configuration#

The claim_config block tells the service where to find authorization data inside the JWT payload.

Claim config keyDefaultDescription
roles_claimrealm_access.rolesJSON path to the roles array
domain_claimdomClaim containing the tenant domain
admin_domain_claimadmClaim granting admin-level domain access

Nested claim paths use dot-notation (realm_access.roles means payload.realm_access.roles).

Self-hosted mode claim config#

In selfhost mode, claim config is set via environment variables (no IdP registration needed):

env
ROLES_CLAIM=realm_access.roles
DOMAIN_CLAIM=dom
ADMIN_DOMAIN_CLAIM=adm
EXCLUDED_ROLES=offline_access,uma_authorization

Keycloak example (self-hosted)#

env
MODE=selfhost
OIDC_ENABLED=true
AUTH_SERVER_URL=https://keycloak.example.com/realms/myrealm
JWKS_URI=https://keycloak.example.com/realms/myrealm/protocol/openid-connect/certs
ROLES_CLAIM=realm_access.roles
DOMAIN_CLAIM=dom

Auth0 example (SaaS tenant)#

json
{
  "issuer_url": "https://your-tenant.us.auth0.com/",
  "jwks_uri": "https://your-tenant.us.auth0.com/.well-known/jwks.json",
  "claim_config": {
    "roles_claim": "https://your-app.com/roles",
    "domain_claim": "https://your-app.com/tenant"
  }
}

JWKS caching and refresh#

The ValidatorCache caches JWKS responses per issuer. Cache entries are lazily created on first token validation. If a JWKS fetch fails, the previous cached validator is used as a fallback, preventing a hard failure on transient IdP downtime.

EC key support

Both RS256 (RSA) and ES256 (EC) tokens are fully supported. If your IdP issues EC-signed tokens, no additional configuration is required — the ValidatorCache resolves the correct key type from the JWKS automatically.