[ Switch to styled version → ]
This document covers integration with identity providers (IDPs), JWT validation, JWKS caching, external IDs, and directory sync.
Enterprise networks can integrate with external identity providers (IDPs) to centralize authentication. Agents can present tokens from an organization’s IDP, such as OIDC, SAML, Entra ID, LDAP, or a custom webhook. The registry validates these tokens before granting access, as an alternative to Pilot’s built-in Ed25519 keys.
Identity integration is configured per-network. Each network can have its own IDP configuration.
Configure an identity provider with the `set_idp_config` protocol command.
# OIDC example
{
"command": "set_idp_config",
"type": "oidc",
"url": "https://accounts.example.com/.well-known/openid-configuration",
"client_id": "pilot-network-prod",
"admin_token": "your-admin-token"
} The IDP configuration is stored in the registry and persists across restarts. The IDP can also be set through a blueprint using the `identity_provider` field.
To query the current configuration:
{
"command": "get_idp_config",
"admin_token": "your-admin-token"
} An `idp.configured` audit event is emitted when the IDP is set or changed.
The registry has built-in JWT validation for two algorithms:
Validate a token with the `validate_token` protocol command:
{
"command": "validate_token",
"token": "eyJhbGciOiJSUzI1NiIs...",
"admin_token": "your-admin-token"
} The command returns `valid` (boolean), `claims` (the decoded JWT claims if valid), or `error` (a string describing the validation failure).
The validator checks the following claims:
For RS256 tokens, the registry fetches the provider’s JSON Web Key Set (JWKS) to get public keys for signature verification. JWKS responses are cached.
If the JWKS endpoint is unreachable and the cache has expired, validation fails. The registry does not accept unverified tokens.
The validator enforces the expected algorithm based on configuration to prevent algorithm confusion attacks. The `alg` header in the JWT must match the configured algorithm.
A 60-second clock skew tolerance is applied to all time-based claims (`exp`, `nbf`, `iat`) to accommodate minor clock differences between the IDP and the registry.
For systems that do not support OIDC or SAML, a webhook identity provider can be configured. The registry sends an agent’s credentials to an HTTP endpoint, which returns an approval or rejection.
# Configure a webhook IDP
{
"command": "set_idp_config",
"type": "webhook",
"url": "https://auth.example.com/verify-agent",
"admin_token": "your-admin-token"
} The endpoint receives a POST request with the agent’s identity information and must return a JSON response indicating whether the agent is authorized.
Agents can be mapped to external identity systems using external IDs.
# Set an external ID for an agent
{
"command": "set_external_id",
"node_id": 5,
"external_id": "[email protected]",
"admin_token": "your-admin-token"
}
# Look up an agent’s identity
{
"command": "get_identity",
"node_id": 5,
"admin_token": "your-admin-token"
} External IDs are free-form strings, such as email addresses or UPNs. They are stored in the registry and included in audit events. An `identity.external_id_set` audit event is emitted on change.
Directory sync pushes entries from an external directory to the registry, which automatically provisions and deprovisions network members.
The sync operation is performed with the `directory_sync` command.
{
"command": "directory_sync",
"network_id": 1,
"entries": [
{
"external_id": "[email protected]",
"node_id": 5,
"role": "admin",
"tags": ["frontend", "us-east"]
},
{
"external_id": "[email protected]",
"node_id": 8,
"role": "member"
}
],
"remove_unlisted": true,
"admin_token": "your-admin-token"
} The sync operation performs the following actions:
Directory sync supports role pre-assignment. When a new member is added through sync, they receive their assigned role immediately instead of defaulting to the member role.
Query the sync status with the `get_directory_status` command.
{
"command": "get_directory_status",
"network_id": 1,
"admin_token": "your-admin-token"
} The command returns the last sync timestamp, number of entries processed, and any errors. A `directory.synced` audit event is emitted after each sync.