AttestoClient.AuthorizationTransaction (AttestoClient v2.26.0)

Copy Markdown View Source

One-time state for an OAuth or OpenID Connect authorization transaction.

Transactions bind the callback to the issuer, client, redirect URI, nonce, PKCE verifier, and opaque initiating browser-session value that created it. They are deliberately stored behind the AttestoClient.AuthorizationTransaction.Store behaviour so applications can choose storage appropriate to their topology. The included ETS store is suitable for a single node; clustered deployments should provide a store with equivalent atomic put_new and take semantics.

Optional DPoP provenance pins the initiating public-key thumbprint; callback must use the same signing key. The explicit generic, HAIP, or FAPI profile and its authentication identity are pinned at start; callback options cannot weaken them. HAIP/FAPI require authenticated PAR and a DPoP private key. Authentication bindings retain public key identity or a secret digest rather than private keys or attestation JWTs.

:expires_at is the transaction's deadline as Unix milliseconds. AttestoClient.AuthorizationCode.callback/3 refuses a transaction past it, whichever way the transaction was kept.

A transaction contains protocol secrets, especially the PKCE verifier and browser binding. Never log it, and never send it to the browser in a form the browser can read. An application that keeps the transaction itself (AttestoClient.AuthorizationCode.start/2 with :return) must encrypt it before it leaves the server; signing alone exposes the verifier.

Summary

Types

t()

@type t() :: %AttestoClient.AuthorizationTransaction{
  browser_binding: String.t(),
  client_auth_binding: map() | nil,
  client_id: String.t(),
  code_verifier: String.t(),
  dpop_jkt: String.t() | nil,
  expires_at: integer() | nil,
  id_token_alg: String.t() | nil,
  issuer: String.t(),
  issuer_aliases: [String.t()],
  max_age: non_neg_integer() | nil,
  metadata: map(),
  nonce: String.t(),
  profile: :generic | :haip | :fapi,
  protocol: :oidc | :oauth,
  redirect_uri: String.t(),
  require_response_issuer: boolean(),
  resources: [String.t()],
  scopes: [String.t()],
  state: String.t()
}