Prepare the request credentials
Use credentials issued for the same API environment and registered client. A valid signature alone does not authorize a request. Before each request, confirm these values:- The access token came from the issuer discovered for the target environment
- The token audience matches that environment’s API resource
- The grant includes every scope listed on the OpenAPI operation
- The DPoP key matches the key bound to the token
- A browser request uses an exact origin registered to the token’s client
Send both required headers
Protected OpenAPI operations list thePerfloOAuth and PerfloDPoPProof security schemes together. Send both headers on the same request:
Authorization header contains the Perflo access token. The DPoP header contains a new proof for the exact method and normalized target URI.
The proof must include the access-token hash in ath. Its iat cannot be older than 60 seconds or more than 10 seconds in the future. Use a unique jti for every request.
Never use the Bearer scheme, cookies, query parameters, or request bodies as API credentials. Perflo does not fall back to another credential source when either required header is missing.
Respond to a nonce challenge
Perflo can require a protected-resource nonce to prevent pre-generated proofs. A nonce challenge returnsWWW-Authenticate and DPoP-Nonce response headers.
Store resource-server nonces separately from authorization-server nonces. Replace the stored resource nonce with the newest DPoP-Nonce, then sign a new proof with a new jti and iat.
Do not retry the challenged proof. Its signature remains valid only for its original claims.
Send browser requests from the registered origin
Perflo evaluates Cross-Origin Resource Sharing (CORS) against the enabled client identified by the validated token. An accepted preflight does not authenticate the protected request. The actual request must use the same exact registered origin. Perflo rejectsOrigin: null, wildcard matching, unregistered origins, and origins registered to a different client.
Cross-origin responses never allow credentials. See Call Perflo from a browser for the complete browser flow.
Handle an authorization failure
Use the response status and challenge to choose the next action:401means the token, proof, nonce, client, grant, or revocation state failed authentication403means the authenticated grant lacks a route scope or violates an access policy409withprovider_reconnect_requiredmeans the connected provider must be reconnected429withrate_limit_exceededmeans you must wait for the integerRetry-Afterinterval503withauthorization_keys_unavailable,authorization_state_unavailable,rate_limit_state_unavailable, oroperation_state_unavailablemeans a required signing-key, live authorization or audit, shared rate-limit, or durable operation-state dependency is unavailable and the request failed closed