auth
oauth

Exchange an authorization code

Exchange an authorization code (from the redirect) plus the PKCE code verifier for the account JWT. Single-use; verifies the code is bound to the same client_id and redirect_uri.

post/auth/oauth/token

Request

  • Base URL: https://api.namefi.io/v-next
  • URL: https://api.namefi.io/v-next/auth/oauth/token
  • Auth: one of:
    • API key in header x-api-key
    • HTTP bearer

Headers

x-namefi-eip7702-accountstring

Optional delegated account address to authenticate as when the signer is an approved signer. Preferred header name.

x-namefi-eip1271-accountstring

Legacy alias for x-namefi-erc1271-account. When multiple delegated account headers are present, x-namefi-eip7702-account takes precedence, then x-namefi-erc1271-account.

x-namefi-erc1271-accountstring

Optional delegated account address to authenticate as when the signer is an approved signer. Preferred ERC-1271 header name.

Request body

codestring required

Authorization code received on the redirect_uri.

codeVerifierstring required

PKCE code verifier matching the codeChallenge from authorize.

clientIdstring required

The client_id the authorization code was issued for.

redirectUristring uri required

The redirect_uri the authorization code was issued for.

resourcestring uri

Optional RFC 8707 resource indicator. When provided it must match the resource the authorization code was issued for; the minted JWT is already bound to that resource.

Response

OK

tokenstring required

JWT to send as an Authorization: Bearer credential.

tokenType'Bearer' required
expiresAtstring date-time required

ISO timestamp after which the token expires.

Changes

No recorded changes to this operation across all 1 revision of this API.