Skip to main content

Machine identity provider API

egret mini machine-IdP: OIDC discovery, JWKS, and token minting (client_credentials + RFC 8693 token exchange).

This page lists 3 endpoints (OpenAPI tag idp). It is generated from openapi.json; see the REST API overview for authentication, CSRF and error conventions.

MethodPathOperation idNotes
GET/.well-known/jwks.jsonjwks
GET/.well-known/openid-configurationdiscovery
POST/oauth/tokentoken_endpoint

GET /.well-known/jwks.json​

Operation id: jwks. Auth: None (public).

Response 200 (application/json): JwksDoc

FieldTypeRequiredDescription
keysobject[]yes
StatusMeaning
200The IdP's active public JWKs (for JWT verification)
500Internal error

GET /.well-known/openid-configuration​

Operation id: discovery. Auth: None (public).

Response 200 (application/json): DiscoveryDoc

FieldTypeRequiredDescription
issuerstringyes
jwks_uristringyes
token_endpointstringyes
grant_types_supportedstring[]yes
id_token_signing_alg_values_supportedstring[]yes
StatusMeaning
200OIDC discovery metadata for the egret machine-IdP

POST /oauth/token​

Operation id: token_endpoint. Auth: None (client credentials in the body).

Request body (application/x-www-form-urlencoded): TokenForm

FieldTypeRequiredDescription
grant_typestring, nullablenoRequired: client_credentials or urn:ietf:params:oauth:grant-type:token-exchange.
client_idstring, nullablenoRequired for client_credentials.
client_secretstring, nullablenoRequired for client_credentials.
subject_tokenstring, nullablenoRequired for token exchange: an unexpired access token this IdP issued. A Bearer Authorization header alone does not stand in for it.
subject_token_typestring, nullablenoRequired for token exchange: urn:ietf:params:oauth:token-type:access_token.
scopestring, nullablenoAccepted and ignored.

Response 200 (application/json): TokenResp

FieldTypeRequiredDescription
access_tokenstringyes
token_typestringyes
expires_ininteger (int64)yes
StatusMeaning
200A signed access token (client_credentials, or an RFC 8693 exchange of an unexpired token this IdP issued for a fresh one with the same client and audience)
400OAuth \{ "error": ... \} body: invalid_request (a field the grant requires is missing or malformed; carries error_description), invalid_grant (the subject_token is invalid, expired, foreign, for another audience, or its client was...
401Invalid client credentials (OAuth \{ "error": ... \} body)
429Too many failed token requests (OAuth \{ "error": ... \} body). client_credentials counts every request that runs a secret check, per ip+client_id; a token exchange counts a subject token that fails verification per ip, and one that names...
500Internal error