Back to all resources
Token IntrospectToken IntrospectJson

Token Introspect: How do I validate tokens with an OAuth 2.0 introspection endpoint or RFC 8414 discovery?

Two Token Introspect configurations for authorization servers that are not plain OpenID Connect providers: online_oauth2_validation posts an opaque token to an RFC 7662 introspection endpoint with client credentials, and offline_validation.discovery = rfc8414 fetches a JWT issuer's keys from its OAuth 2.0 authorization-server metadata. Shows the create, the read that never returns the client secret, the update that keeps it, and the exact 422 messages.

Token Introspect: How do I validate tokens with an OAuth 2.0 introspection endpoint or RFC 8414 discovery?

A Token Introspect configuration tells the platform how to validate the end-user tokens your application forwards in the Authorization header and which graph node type they stand for. Besides offline validation with OpenID Connect discovery and online validation at a userinfo endpoint, two modes cover authorization servers that follow the OAuth 2.0 RFCs rather than OpenID Connect:

1. online_oauth2_validation - for opaque tokens (and JWTs) issued by a server with an RFC 7662 token introspection endpoint. The platform posts the token to introspection_endpoint with HTTP Basic authentication (client_secret_basic), accepts it only when the response carries "active": true, and uses the response's claims as the token's claims. cache_ttl, in seconds and at most 3600, caches a positive result up to the token's exp; without it every request introspects.

2. offline_validation with discovery "rfc8414" - for JWTs whose issuer publishes RFC 8414 authorization-server metadata instead of an OpenID document. With no public_jwks pinned, the platform reads jwks_uri from https://<host>/.well-known/oauth-authorization-server/<issuer path>, the well-known suffix inserted between the host and the path of the issuer. The default, "oidc", reads <issuer>/.well-known/openid-configuration.

client_secret is write-only: a read returns secret_basic with client_id only, and an update may leave client_secret out to keep the stored value, unless introspection_endpoint or client_id changes in the same update.

Use case

Scenario: Your users sign in at an OAuth 2.0 authorization server that issues opaque access tokens and exposes a token introspection endpoint, not a userinfo endpoint. A second tenant of the same server issues JWTs and publishes its metadata under /.well-known/oauth-authorization-server. Both token kinds must resolve to a Person node so that ContX IQ and AuthZEN can act for the signed-in user.

Two Token Introspect configurations in the project, one per matcher, give each token the validation it needs: the opaque tokens are introspected with the platform's client credentials; the JWTs are verified locally with the keys the RFC 8414 document names. Your application changes nothing: it forwards the user's token as before, and the platform picks the configuration whose matcher fits.

Requirements

Prerequisites:

- ServiceAccount credentials: Bearer token in the Authorization header for the Config API calls below.

- A project id (project_id).

- For the OAuth 2.0 mode: the authorization server's RFC 7662 introspection endpoint over https, and a client id and secret it accepts with HTTP Basic authentication.

- For the RFC 8414 mode: the issuer value (iss claim) your JWTs carry, over https, and the audience value (aud claim); the server must publish /.well-known/oauth-authorization-server for that issuer.

Required API access:

- POST /configs/v1/token-introspects

- GET /configs/v1/token-introspects/{id}

- PUT /configs/v1/token-introspects/{id}

Steps

Step 1: Create the OAuth 2.0 introspection configuration

- Authentication: ServiceAccount credential as Bearer token.

- Action: POST /configs/v1/token-introspects with opaque_matcher.hint and online_oauth2_validation (introspection_endpoint, secret_basic.client_id and client_secret, optional cache_ttl), plus ikg_node_type.

- Result: 201 with the configuration id and an etag header. The introspection endpoint is checked when the configuration is saved: a plain http URL, or a host that resolves to a private address, is refused with 422.

Step 2: Read it back

- Action: GET /configs/v1/token-introspects/{id}.

- Result: online_oauth2_validation with introspection_endpoint, cache_ttl and secret_basic.client_id; client_secret is never returned, not even as a key. The other validation modes are null.

Step 3: Update without re-sending the secret

- Action: PUT /configs/v1/token-introspects/{id} with the full configuration again (PUT is a replacement) and secret_basic.client_id only.

- Result: 200; the stored client_secret is kept because neither introspection_endpoint nor client_id changed. If one of them changes, the body must carry a new client_secret, otherwise 422 with online OAuth2 validation requires secret_basic.client_secret, when the introspection endpoint or client_id changes.

Step 4: Create the RFC 8414 discovery configuration

- Action: POST /configs/v1/token-introspects with jwt_matcher.issuer and audience, offline_validation.discovery = "rfc8414" and ikg_node_type.

- Result: 201. A read returns offline_validation as {"public_jwks": [], "discovery": "rfc8414"}. Two configurations of one project cannot share an issuer and audience, nor an opaque hint: the second is refused with 409.

Step 5: See the validation messages

- Action: POST a body with a malformed introspection_endpoint, no client_id and a cache_ttl above 3600.

- Result: 422 listing one entry per field.

Step 1

Create the OAuth 2.0 introspection configuration. An opaque token carries no claims of its own, so an opaque_matcher needs one of the two online modes; this one posts the token to introspection_endpoint with client_secret_basic. introspection_endpoint must be https and is configured explicitly, there is no discovery for it.

POST https://eu.api.indykite.com/configs/v1/token-introspectsJson
{
  "name": "oauth2-token-introspect",
  "display_name": "OAuth 2.0 introspection",
  "description": "Validates opaque tokens at the authorization server's RFC 7662 introspection endpoint",
  "project_id": "gid-of-project",
  "opaque_matcher": {
    "hint": "my.domain.com"
  },
  "online_oauth2_validation": {
    "introspection_endpoint": "https://auth.example.com/oauth2/introspect",
    "secret_basic": {
      "client_id": "indykite-introspector",
      "client_secret": "<client-secret-issued-by-your-authorization-server>"
    },
    "cache_ttl": 300
  },
  "ikg_node_type": "Person",
  "perform_upsert": true
}

Step 2

Read the configuration back. secret_basic carries client_id only: the client secret is write-only and never returned.

GET https://eu.api.indykite.com/configs/v1/token-introspects/{id}Json

HTTP/2 200
etag: "a1b2c3"

{
  "id": "gid-of-token-introspect",
  "name": "oauth2-token-introspect",
  "display_name": "OAuth 2.0 introspection",
  "description": "Validates opaque tokens at the authorization server's RFC 7662 introspection endpoint",
  "project_id": "gid-of-project",
  "jwt_matcher": null,
  "opaque_matcher": {
    "hint": "my.domain.com"
  },
  "offline_validation": null,
  "online_validation": null,
  "online_oauth2_validation": {
    "introspection_endpoint": "https://auth.example.com/oauth2/introspect",
    "secret_basic": {
      "client_id": "indykite-introspector"
    },
    "cache_ttl": 300
  },
  "ikg_node_type": "Person",
  "perform_upsert": true,
  "create_time": "2026-10-28T09:12:44Z",
  "update_time": "2026-10-28T09:12:44Z"
}

Step 3

Replace the configuration with a longer cache_ttl. client_secret is left out and the stored value is kept, because introspection_endpoint and client_id are unchanged. Send the etag from Step 2 as If-Match to get 412 instead of overwriting a concurrent change.

PUT https://eu.api.indykite.com/configs/v1/token-introspects/{id}Json
{
  "opaque_matcher": {
    "hint": "my.domain.com"
  },
  "online_oauth2_validation": {
    "introspection_endpoint": "https://auth.example.com/oauth2/introspect",
    "secret_basic": {
      "client_id": "indykite-introspector"
    },
    "cache_ttl": 600
  },
  "ikg_node_type": "Person",
  "perform_upsert": true
}

Step 4

Create the RFC 8414 discovery configuration for a JWT issuer. With no public_jwks, discovery selects the metadata document that names jwks_uri: "rfc8414" reads https://auth.example.com/.well-known/oauth-authorization-server/tenant-a for this issuer. Leave discovery out, or set "oidc", for an OpenID Connect issuer.

POST https://eu.api.indykite.com/configs/v1/token-introspectsJson
{
  "name": "rfc8414-token-introspect",
  "display_name": "RFC 8414 discovery",
  "description": "Validates JWTs with the keys published by the issuer's OAuth 2.0 authorization server metadata",
  "project_id": "gid-of-project",
  "jwt_matcher": {
    "issuer": "https://auth.example.com/tenant-a",
    "audience": "client-id-of-your-app"
  },
  "offline_validation": {
    "discovery": "rfc8414"
  },
  "ikg_node_type": "Person",
  "perform_upsert": true
}

The read of that configuration: discovery is returned next to an empty public_jwks list.

GET https://eu.api.indykite.com/configs/v1/token-introspects/{id}Json

HTTP/2 200
etag: "d4e5f6"

{
  "id": "gid-of-token-introspect",
  "name": "rfc8414-token-introspect",
  "display_name": "RFC 8414 discovery",
  "description": "Validates JWTs with the keys published by the issuer's OAuth 2.0 authorization server metadata",
  "project_id": "gid-of-project",
  "jwt_matcher": {
    "issuer": "https://auth.example.com/tenant-a",
    "audience": "client-id-of-your-app"
  },
  "opaque_matcher": null,
  "offline_validation": {
    "public_jwks": [],
    "discovery": "rfc8414"
  },
  "online_validation": null,
  "online_oauth2_validation": null,
  "ikg_node_type": "Person",
  "perform_upsert": true,
  "create_time": "2026-10-28T09:14:02Z",
  "update_time": "2026-10-28T09:14:02Z"
}

Step 5

A body that breaks three rules at once: introspection_endpoint is not a URL, secret_basic has no client_id, and cache_ttl exceeds 3600.

POST https://eu.api.indykite.com/configs/v1/token-introspectsJson
{
  "name": "oauth2-token-introspect-broken",
  "project_id": "gid-of-project",
  "opaque_matcher": {
    "hint": "another.domain.com"
  },
  "online_oauth2_validation": {
    "introspection_endpoint": "not-url",
    "secret_basic": {
      "client_secret": "<client-secret>"
    },
    "cache_ttl": 3601
  },
  "ikg_node_type": "Person"
}

422: one entry per failed rule.


HTTP/2 422

{
  "message": "Unprocessable Entity",
  "errors": [
    "invalid field online_oauth2_validation.introspection_endpoint: \"not-url\" does not meet rule http_url",
    "missing field online_oauth2_validation.secret_basic.client_id",
    "invalid field online_oauth2_validation.cache_ttl: 3601 does not meet rule max=3600"
  ]
}

API Endpoints

/configs/v1/token-introspects
/configs/v1/token-introspects/{id}
View OpenAPI docs

Tags

Token IntrospectOAuth 2.0RFC 7662RFC 8414Opaque TokenJWTDiscoveryConfig API