Token & JWKS Reference

Endpoint, parameter, and claim reference for Hawcx's JWT-issuance and JWKS surfaces

This page documents Hawcx's token-issuance and JWKS endpoints, and the claim set carried by Hawcx-issued ID Tokens. For a walkthrough of how the pieces fit together, see the ID Token verification guide.

All endpoints are scoped per environment. The examples below use https://api.hawcx.com (production). Substitute the issuer URL for your environment as provided in the Admin Console.

Discovery Document

Hawcx provides this document as a convenience for OIDC-compatible JWT libraries that auto-fetch it. Verification works equally well by fetching the JWKS endpoint directly. See the JWKS Endpoint section below.

URL: {issuer}/.well-known/openid-configuration

Method: GET

Authentication: None.

The document is identical for every project served by a given environment.

Response Fields

FieldTypeDescription
issuerstringThe issuer identifier. Equals the environment's issuer URL with no trailing slash.
token_endpointstringURL of the token endpoint.
jwks_uristringURL of the JSON Web Key Set used to verify ID Token signatures.
subject_types_supportedarrayAlways ["public"]. The sub claim is the same opaque identifier for all relying parties.
id_token_signing_alg_values_supportedarrayAlgorithms advertised by the active signing key. One of ["ES256"], ["ES512"], or ["EdDSA"].
scopes_supportedarrayAlways ["openid", "profile", "email"].
token_endpoint_auth_methods_supportedarrayAlways ["none"]. Caller identification is via the API gateway; no client secret is required or accepted at the token endpoint.
claims_supportedarrayClaims that may appear in the ID Token.

Hawcx is not a full OpenID Provider. The discovery document omits authorization_endpoint, userinfo_endpoint, registration_endpoint, revocation_endpoint, response_types_supported, grant_types_supported, and code_challenge_methods_supported, since those describe a redirect flow Hawcx doesn't have. PKCE is still enforced at the token endpoint; only its discovery metadata is omitted. Use a JWT library, not a full OIDC client.

ID Token

ID Tokens are OIDC Core 1.0 §2-conformant signed JWTs. The signing algorithm matches the value advertised in the discovery document's id_token_signing_alg_values_supported field.

Claims

ClaimTypeDescription
issstringThe issuer URL. Must equal the discovery document's issuer field.
substringOpaque, stable user identifier. Use this as the identity key linking your user records to Hawcx (most apps store it as a unique-indexed column and keep their own internal primary key).
audstringThe project's Client ID (the audience your backend pins). Auto-generated as a UUID at project creation, renameable in the Admin Console. See Changing the audience value.
iatintegerIssued-at time, Unix epoch seconds.
nbfintegerNot-before time. Tokens are valid from this instant.
expintegerExpiration time. Default lifetime is 3600 seconds.
jtistringUnique token identifier (UUIDv4). Use to detect replay.
auth_timeintegerTime when end-user authentication completed, Unix epoch seconds.
noncestringEchoed from the authentication request when supplied. Verify equality on the client. Omitted entirely when the auth request did not supply a nonce.
amrarrayAuthentication Methods References per RFC 8176. Always includes "swk". When MFA was performed, adds "mfa" plus the specific factor ("otp" for TOTP or email OTP, "sms" for SMS OTP).
acrstringAuthentication Context Class Reference. Always urn:hawcx:pwdless:v1.
emailstringUser's email address. Present when known.
email_verifiedbooleantrue when email is present. Hawcx only stores verified addresses.
phone_numberstringOIDC Core §5.1 standard phone claim. Present when known.
phonestringLegacy phone claim, emitted alongside phone_number during the deprecation window. New integrations should read phone_number.
cnfobjectConfirmation claim. When token binding is in use, contains jkt, the SHA-256 thumbprint of the JWK the token is bound to.

The previous top-level mfa_method claim has been removed. The factor used is now expressed inside amr per RFC 8176.

Token Endpoint

Hawcx's code-exchange endpoint. The request and response shapes resemble RFC 6749 §4.1.3 / §4.1.4, but the endpoint is Hawcx-specific: it does not issue an access_token (Hawcx has no UserInfo or proprietary API for an access token to access), and the authorization code originates from a Hawcx-proprietary auth flow rather than an OAuth authorize redirect.

URL: {issuer}/oauth2/token

Method: POST

Content-Type: application/x-www-form-urlencoded

Authentication: None at this endpoint. The PKCE code_verifier proves the caller possessed the original verifier when the code was minted; project identification is via the gateway header below.

Exchanges an authorization code for a signed ID Token. The code is single-use and short-lived.

Required Headers

HeaderDescription
X-Config-IdYour Hawcx project credential. Injected automatically when you call through the Hawcx API gateway.
Content-TypeMust be application/x-www-form-urlencoded.

Request Parameters

ParameterTypeRequiredDescription
codestringYesThe authorization code received from the Hawcx SDK at the end of the auth flow.
code_verifierstringYesThe PKCE verifier. The original random string whose S256 hash was supplied as code_challenge when the auth flow began. The challenge method must be S256; any other value was rejected at mint time.

Response Body

FieldTypeDescription
id_tokenstringA signed JWT containing the user's identity claims.
token_typestringAlways "Bearer".
expires_inintegerLifetime of the id_token, in seconds.

Response Headers

HeaderValueNotes
Cache-Controlno-storePer RFC 6749 §5.1. Prevents intermediaries from caching freshly minted tokens.
Pragmano-cachePer RFC 6749 §5.1, for HTTP/1.0 compatibility.

Token Endpoint Errors

Errors are returned as application/json with error and error_description fields, following OAuth 2.1 error conventions. The endpoint deliberately collapses several distinct failure modes into a uniform invalid_grant to avoid leaking which step failed.

HTTP StatuserrorWhen it occurs
400invalid_requestThe X-Config-Id header is missing or refers to an unknown project.
400invalid_grantThe authorization code was not found, has expired, has already been used, was minted without a PKCE challenge, has an unsupported challenge method, or the code_verifier does not match.
500server_errorThe project's OAuth configuration is incomplete (missing issuer or client_id in the project's OAuth settings), or the project's configured issuer does not match the environment's discovery issuer. Operational error; contact support.
503temporarily_unavailableThe signer or the per-project Redis is temporarily unreachable. Safe to retry with backoff.

JWKS Endpoint

URL: {issuer}/.well-known/jwks.json

Method: GET

Authentication: None.

Returns the public keys used to verify ID Token signatures. This is the only Hawcx endpoint your JWT library needs to fetch in order to verify tokens.

Response Body

A standard JSON Web Key Set (RFC 7517):

{
  "keys": [
    {
      "kty": "EC",
      "kid": "5f8a...",
      "alg": "ES256",
      "use": "sig",
      "crv": "P-256",
      "x": "...",
      "y": "..."
    }
  ]
}
FieldTypeDescription
keysarrayOne or more public keys. Hawcx currently exposes a single key per environment.
keys[].kidstringKey ID. Match against the kid in the ID Token's JWT header to select the verification key.
keys[].algstringSigning algorithm. One of ES256, ES512, EdDSA.
keys[].usestringAlways "sig".
keys[].ktystringKey type. EC for ES256/ES512, OKP for EdDSA.
keys[].crvstringCurve. P-256 for ES256, P-521 for ES512, Ed25519 for EdDSA.
keys[].x, keys[].ystringPublic key coordinates, base64url-encoded. (y is omitted for EdDSA.)

JWKS Endpoint Errors

HTTP StatuserrorWhen it occurs
503temporarily_unavailableThe signer is unreachable or the backing KMS key cannot be read. Safe to retry with backoff.
503server_errorThe JWKS source is misconfigured. Operational error; contact support.