All notable changes to this project are documented here. The format is based on Keep a Changelog. Public functions and behaviour contracts remain compatible within 5.x where security permits; security and correctness fixes may tighten validation or derived defaults in a minor release.

[5.0.0] - 2026-12-01

Requires attesto >= 2.33.0 and < 3.0.0.

Breaking

  • CIBA now defaults :require_signed_request to false, as FAPI-CIBA Draft 04 requires authorization servers to support unsigned backchannel requests unless another FAPI 2.0 profile requires signatures. A deployment whose profile mandates signed requests must set ciba: [require_signed_request: true]; that setting still requires a shared atomic :replay_check. Optional signed requests continue to fail closed without replay storage.
  • Hosts with signed CIBA clients must return the registered :request_signing_alg from client_ciba_registration/1. A non-nil value requires signed requests using exactly that algorithm; an absent or nil value rejects signed requests. This closes unsigned downgrade and unregistered-signature paths that earlier releases accepted.

Changed

  • Compatibility entry points deprecated in 4.x remain available through 5.x; their warnings now consistently schedule removal for 6.0. This keeps the 5.0 break focused on the documented CIBA policy correction.

Added

  • ciba: [login_hint_token_types_supported: [...]] advertises backchannel_endpoint_login_hint_token_types_supported in both authorization server and OpenID Provider metadata. Values are bounded, unique, control-free UTF-8 strings.
  • Dynamic registration validates and preserves the FAPI-CIBA Draft 04 backchannel_endpoint_login_hint_token_types client metadata array and rejects types outside the server's advertised catalog.
  • Signed-request algorithms are advertised only when replay storage is wired, so discovery never claims a capability the request path will reject.

[4.29.0] - 2026-12-01

Added

  • resource_indicators: [default_resources_for: callback] chooses the RFC 8707 resources for a request that names none (#39). The callback receives the client and the effective scope, after the :authorize_scope default for an omitted scope, and returns resource identifiers. It runs only when the request carries no resource: at the authorization endpoint (direct, pushed, and resumed requests), device authorization, and CIBA. The result passes the same checks as a requested resource, so a malformed or unserved identifier is invalid_target and the callback cannot widen what a client may target. The bound resources set the access-token aud at redemption and refresh as a requested resource does. This serves clients that never send resource, such as Microsoft Copilot Studio's MCP connector, when each protected resource requires its own audience. Unset, or [], keeps the :audience default.
  • With the callback configured, device authorization and CIBA requests that name no resource run the :authorize_scope policy at the request endpoint to find the effective scope; a refusal there is invalid_scope. At the authorization endpoint a three-argument :authorize_scope policy is asked again with the bound default and may only narrow, so it refuses or narrows before the resource owner is asked rather than at redemption.
  • ConsentGrant.binding_from_params/3 and safe_binding_from_params/3 take a :resource option, the bound request.resource, so a consent minted for a request whose resource was defaulted matches ConsentGrant.binding/2.
  • Thanks to @oliver-kriska for the contribution in #40.

[4.28.0] - 2026-11-26

Requires attesto >= 2.32.0 and < 3.0.0 and db_connection >= 2.10.3 and < 3.0.0.

Security

  • Raises the db_connection floor to 2.10.3. Earlier releases can execute the :log MFA from a forged DBConnection.Stream or DBConnection.PrepareStream when a downstream component builds one from untrusted input and enumerates it (CVE-2026-133555, GHSA-gmmq-fw75-wq46). AttestoPhoenix does not deserialize untrusted Erlang terms; the direct floor prevents a host lock from retaining an affected transitive release.

Changed

  • JWT-bearer trusted-issuer discovery uses Attesto's shared metadata candidate ordering: RFC 8414 path insertion, OpenID Connect path insertion, then OpenID Connect path appending. This adds the required OpenID Connect path-insertion form for path-based issuers and removes the duplicated URL construction from the Phoenix package.
  • Discovery advances to another metadata URL only after HTTP 404. A malformed document, issuer mismatch, transport failure, or any other HTTP status fails closed instead of trying a different protocol document.

[4.27.1] - 2026-11-23

Requires attesto >= 2.31.1 and < 3.0.0.

Security

  • A refresh token presented by a client it was not issued to gets "the refresh token is invalid or its authorization was revoked" whether the token is live, expired or already rotated. In 4.27.0 an expired token gave "the refresh token has expired" and a rotated one gave the reuse description and revoked the owner's family, which told the presenter the token existed and belonged to another client. Attesto 2.31.1 checks the client binding first.
  • The three places the token endpoint reads a presented refresh token before rotating it treat a token not bound to the requesting client and this issuer as absent, the same as an unknown token: the credential authorization_details check, the DPoP replay claim, and the :refresh_completion callback. Before, a client the token was not issued to could tell an existing token from an unknown one by the invalid_authorization_details response, by whether its DPoP proof was claimed, or by the host callback running with the owner's subject and session.

Changed

  • A rotated refresh token presented by a different client no longer emits :refresh_reuse_detected or revokes the family; it gets :token_denied. Core telemetry reports it at [:attesto, :refresh_token, :client_mismatch].

[4.27.0] - 2026-11-22

Security

  • Requires phoenix ~> 1.7.25 or >= 1.8.17 and < 2.0.0 (was ~> 1.7.24 or >= 1.8.9). Phoenix before 1.7.25 and 1.8.17 crashes shared broadcast dispatch when a client selects the V1 serializer and sends a binary payload (CVE-2026-129344, GHSA-5vmc-qgf8-rw36), and crashes the Presence tracker on an unsanitized presence key (CVE-2026-128361, GHSA-pvfx-rx4x-phrr). AttestoPhoenix uses neither Channels nor Presence; the floor moves hosts that do onto the fixed releases.

Changed

  • Refresh-token invalid_grant responses carry a reason-specific error_description. The error code and HTTP status are unchanged (RFC 6749 §5.2). Clients that matched the old text, "authorization grant is invalid or expired", must update.
    • Expired: "the refresh token has expired".
    • Reused after rotation: "the refresh token was already used; every token from this authorization has been revoked".
    • Revoked during rotation: "the authorization behind the refresh token has been revoked".
    • Unknown, previously revoked, or presented by a client or issuer it was not issued to: "the refresh token is invalid or its authorization was revoked". These cases share one text so a presenter cannot tell that a token was issued to someone else.
    • A missing, unexpected or mismatched DPoP or client attestation proof names the proof and the problem.
  • Authorization code, device code, CIBA, token exchange, pre-authorized code and ID-JAG errors are unchanged.

[4.26.0] - 2026-11-20

Requires attesto >= 2.31.0 and < 3.0.0.

Added

  • The token endpoint accepts client ID metadata document clients authenticated with private_key_jwt for the ID-JAG grant. Hosts can opt into public-client redemption with jwt_bearer: [public_clients: :allow].
  • The server discovers issuer keys via RFC 8414 metadata, with an OpenID Connect Discovery fallback on HTTP 404. The server refreshes a cached set on an unknown key ID at most once per issuer per node within a 30-second window.
  • Hosts can resolve issuer and tenant trust with :resolve_trusted_issuer. A two-argument :resolve_jwt_bearer_subject callback receives the verified aud_tenant and host context. The one-argument callback still works.
  • The authorization server advertises the ID-JAG profile when the JWT-bearer grant is available (ID-JAG draft -06 §7.2).

Changed

  • The token endpoint grants signed authorization_details for configured ID-JAG types and includes the granted objects in the token and token response (ID-JAG draft -06 §4.4.1 and RFC 9396).
  • The server uses discovery by default for a trusted issuer without static keys or a JWKS URI. Set discovery: false to disable it.

Breaking

  • The token endpoint returns access_denied for subject denials and explicit principal-builder denials (ID-JAG draft -06 §4.4.3). Hosts that handle these denials as invalid_grant must update their error handling.

[4.25.0] - 2026-11-20

Requires attesto >= 2.30.0 and < 3.0.0.

Breaking

  • The server refuses RSA keys under 2048 bits and certificates with unsupported keys or signatures, duplicate extension OIDs, or cA set to TRUE on a leaf other than the selected trust anchor, including under an explicit non-FAPI or broader algorithm policy (RFC 7518 §3.3, RFC 5280). Hosts see invalid_client for refused client assertions and invalid_request for refused signed CIBA requests or credential presentations.

[4.24.0] - 2026-11-19

Security

  • Requires idna ~> 8.0. Before idna 8.0.0, an overlong Punycode label was decoded before its length was checked, causing super-linear CPU use. EEF-CVE-2026-117678, CVE-2026-117678.
  • DNS hosts from CIMD client_id, logo and JWKS URLs, fetch redirects, and redirect URI registration are limited to 253 code points per name and 63 per label before IDNA encoding. The encoded name and its labels must also fit the DNS octet limits.

Breaking

  • If you use hackney 1.x, upgrade to hackney 4.11.0 or a later 4.x release that supports idna 8. Hackney 1.x pins idna ~> 6.1.0.
  • Invalid A-labels such as xn--abc-, which decodes to plain ASCII, are now refused. RFC 5890 §2.3.2.1.
  • Unicode labels such as ¡ and ≠ are now accepted under UTS #46 compatibility processing. UTS #46 §4.1.

[4.23.1] - 2026-11-17

Security

  • Requires plug >= 1.20.4 and < 2.0.0. Plug 1.13.0 through 1.20.3 do not count multipart part delimiters, header separators or line endings against Plug.Parsers' :length limit, and hold parts without a content-disposition header in memory until the body has been read, so a request under the limit can take far more memory (CVE-2026-120287, GHSA-qj4r-jh2r-rw3f). No earlier Plug line has a fixed release. A host's endpoint runs that parser for any request with a multipart body, before a route is chosen.

[4.23.0] - 2026-11-15

Requires attesto >= 2.27.0 and < 3.0.0.

Breaking

  • A POST to the end-session or device verification endpoint with a non-empty query string is refused with a 400 before the action runs, as a POST to the authorization endpoint already is. Until now their query and body parameters were merged. A bare ? is accepted, and end-session GET still reads its query.
  • A query or form parameter whose name contains [ is refused with a 400 on every protocol endpoint, the way a repeated name is. No OAuth or OpenID specification defines such a name, and Plug turned state[]=x into a list that the authorization endpoint then ignored. Repeated plain resource (RFC 8707) is still accepted. JSON member names are unaffected. AttestoPhoenix.Controller.ResourceMetadataController now runs the repeated-name and bracketed-name checks too.
  • With :cors_origins set to false, an OPTIONS request to a mounted route gets the unknown-route answer before any parameter check, so a repeated query name no longer turns that 404 into a 400.

Changed

  • :authorization_failed documentation states that it covers requests the authorization endpoint's controller refused; a request the host's Plug.Parsers rejects never reaches the library. The :authorize_scope and :authorize_subject_scope documentation states that resources arrive validated and deduplicated, so resource=R&resource=R is [R].

[4.22.1] - 2026-11-15

Security

  • Requires ecto >= 3.14.3 and < 4.0.0. Ecto 3.4.0 through 3.14.2 grow the query cache without bound from interpolated JSON paths and splice lists (CVE-2026-118391).

[4.22.0] - 2026-11-15

Requires attesto >= 2.26.0 and < 3.0.0. The README section "Upgrading to 4.22" lists what a host changes.

Breaking

  • A protocol request with a form or JSON body is refused unless AttestoPhoenix.DuplicateParameterGuard.read_body/2 read it as the endpoint's Plug.Parsers body reader, and a multipart body on a protocol endpoint is always refused. The :oauth_body_guard option is removed and configuration that sets it raises at boot. Until now a host without the reader processed a POST carrying client_id twice with one of the two values. A test that passes a map of parameters to Phoenix.ConnTest.post/3 is refused as well; send an encoded body with its content type.
  • A POST to the authorization endpoint with any query string is refused before the action runs. Until now its query and body were merged.
  • AttestoPhoenix.Interaction.decide/4 requires an Origin header naming the configured issuer's origin. An absent header, Origin: null, and the origin the request reached when it is not the issuer's are refused with {:error, :cross_origin}. A consent page that sends Referrer-Policy: no-referrer changes it to Referrer-Policy: strict-origin; with no-referrer the browser sends Origin: null. The Sec-Fetch-Site rule is unchanged.
  • :authorization_failed is emitted once for every refused authorization request, including the parameter checks ahead of the action and consent denial, which still emits :authorization_denied too. :result is always the OAuth error code as a string, where some refusals carried an atom. :client_id is set only when the registry knows the client. :metadata carries :client_ip, a fixed :reason atom and :repeated_parameters, the names of repeated parameters without their values.
  • Every Logger.error message is a fixed string. What varied in the message (a failure reason, a callback's name, the consequence) is Logger metadata; the README lists the messages and the formatter keys that print the detail.
  • With Attesto 2.26, Attesto.DPoP.ReplayCache starts only as {Attesto.DPoP.ReplayCache, single_node?: true}. A host that relies on the default replay check for DPoP proofs or jwt-bearer assertions changes its supervision tree, or sets :replay_check to a shared check such as AttestoPhoenix.Store.EctoReplayCheck.check_and_record/2 on every node.

Added

  • :authorize_subject_scope on AttestoPhoenix.Config, and the matching optional AttestoPhoenix.ScopePolicy callback, runs after the resource owner is authenticated on every authorization pass, resume included, with the client, the subject, the scope and the resources. It returns a narrowed scope or refuses with :invalid_scope or :invalid_target. Consent sees the narrowed scope and the code is bound to it.
  • AttestoPhoenix.Interaction.same_origin_request?/1 applies the decision's origin rule to any request, for a host's logout-confirmation handler.
  • The README shows :authorize_scope requiring exactly one resource for a dynamically registered public client. The callback receives an empty list when the request named no resource.

[4.21.0] - 2026-11-15

Added

Fixed

  • The install task, README and migration generator documentation now list the 4.19 upgrade migration, including its timing before rolling nodes without stopping writers.

[4.20.0] - 2026-11-15

Requires attesto >= 2.24.0 and < 3.0.0.

Breaking

  • AttestoPhoenix.Plug.CORS.preflight/2 raises Phoenix.Router.NoRouteError when the effective cors_origins policy is false, so a host's missing-route renderer handles OPTIONS, including per-resource metadata and registration management routes. Outside a router it sends an empty 404. Other policies retain the existing 204 response and headers.
  • AttestoPhoenix.SSRFGuard.screen/2 returns the original URL and every checked address, as documented by Attesto.OutboundTarget. Outbound CIBA ping, Back-Channel Logout and client metadata fetches use core's bounded connection retries; no delivery retry is added after sending starts. A client metadata connect failure returns {:error, {:transport, {:not_sent, cause}}}. Delivery failures after sending starts return {:error, {:maybe_sent, cause}} with core's normalized causes; client metadata wraps these under :transport while retaining :too_large for its document-size limit.

[4.19.0] - 2026-11-15

Requires attesto >= 2.23.0 and < 3.0.0.

Breaking

  • Attesto.CodeStore is now one required behaviour with explicit live, claimed and redeemed states. Reads never write; atomic claim, replay flagging and finish callbacks retain immutable bindings and redemption records, with one revocation flag for replay or grant cut-off. Access-token linkage and revocation callbacks are required. Custom stores must migrate to this contract; the upgrade guide maps every previous callback.
  • Attesto.AuthorizationCode.redeem/4 compares client, redirect URI, PKCE when challenged and DPoP when bound before any state change. A failed comparison no longer spends the code. Reuse revocation applies only to a matching presentation, including after code expiry and during token issuance. Expiry prevents claiming live codes only. This departs from the literal wording of RFC 6749 §4.1.2 so possession of a code alone cannot revoke another client's tokens.
  • Authorization-code redemption always requires the bound client identifier; the client-id opt-out is removed. A verifier presented for a code issued without a PKCE challenge is refused.
  • Existing PostgreSQL databases require the migration generator's --upgrade 4.19 additive migration before rolling nodes. All previous columns keep their meaning. During the roll, old nodes still spend failed presentations and revoke on non-matching replays. Both sweepers keep claims through a five-minute reservation and retain redeemed records while a bundled refresh-family member remains unexpired. External refresh stores use the recorded family deadline. Removed codes become unknown; a missing row at finish revokes newly issued credentials and returns no tokens. The migration adds one nullable provenance column, with no database triggers, functions or rules. New writers preserve authorization provenance separately from redemption family linkage; provenance already overwritten by an old writer cannot be recovered.
  • The token endpoint still returns the same generic invalid_grant body for redemption refusals, and the existing failure event still fires.

Added

  • AttestoPhoenix.Interaction.pending/3 takes subject:. With it, a parked request is returned only when it was parked for that subject. nil, an empty string, another subject, and an entry parked without a subject return {:error, :invalid_resume}; an option other than :subject raises. A consent page passes the subject from the host session and no longer compares pending.subject itself. A call without the option behaves as in 4.18.0.

[4.18.0] - 2026-11-15

Requires attesto >= 2.22.0 and < 3.0.0.

Added

Changed

  • The documented consent pattern parks the request and redirects to a host consent route with the encrypted handle, where it used to render the page from the authorization request. Rendering from the authorization request still works, and a page rendered that way after a resume still cannot be reloaded. The consent route needs conn.secret_key_base.

[4.17.0] - 2026-11-15

Security

  • A subject, client or session revocation that runs while an authorization code is being exchanged now revokes the access token and the refresh family that exchange produces. AttestoPhoenix.Store.EctoCodeStore.delete_unconsumed/1 marks rows that were taken and not yet finalized, and finalization revokes what they minted. The ETS store gets the same protection from attesto 2.21.0.

Breaking

  • Requires attesto >= 2.21.0 and < 3.0.0.
  • AttestoPhoenix.Verifier fetches and enforces credential status references. A revoked or suspended credential, an invalid list and a failed fetch reject the presentation. :verifier_status_resolver replaces the fetch; no option turns enforcement off.
  • CORS (RFC 10017) is on by default. Every endpoint except the authorization, device verification, end-session and check-session endpoints answers with Access-Control-Allow-Origin: * and never with Access-Control-Allow-Credentials, and AttestoPhoenix.Router mounts an OPTIONS route beside each of them. :cors_origins takes a list of origins, a one-arity predicate, or false.
  • :client_assertion_audiences accepts only the issuer and this server's own token, PAR and backchannel authentication endpoint URLs, whether given as a list or returned by a callback. The issuer-only default is unchanged.
  • Client registration refuses a redirect URI whose query carries an authorization request or response parameter. 4.16.0 refused response parameters only.
  • Token exchange refuses a requested_token_type other than urn:ietf:params:oauth:token-type:access_token with invalid_request, unless :identity_chaining is enabled and lists that type.
  • A CIMD metadata fetch that fails transiently answers 503 temporarily_unavailable, where it answered 400. A malformed, invalid or refused document still answers 400.
  • The credential issuer issues dc+sd-jwt only, and Ed25519 and Ed448 signing keys sign as Ed25519 and Ed448; see the attesto 2.21.0 entry for both.
  • Removed AttestoPhoenix.PinnedHTTP. Attesto.PinnedHTTP replaces it.

Added

  • OpenID4VCI 1.0 Credential Request decryption and Credential Response encryption at the credential and deferred credential endpoints, with zip: "DEF" on the response when the wallet asks for it. :credential_encryption_keystore supplies the P-256 keys and must share no key with :keystore; :credential_encryption_required makes encryption mandatory. A request that asks for an encrypted response has to be encrypted itself.
  • Identity chaining (draft-ietf-oauth-identity-chaining-17), off by default under :identity_chaining. A token exchange that names an allowed authorization server in audience or resource, or that sends requested_token_type urn:ietf:params:oauth:token-type:jwt or urn:ietf:params:oauth:token-type:id-jag, returns a JWT authorization grant with token_type: "N_A" and the matching issued_token_type. The authorization server metadata advertises identity_chaining_requested_token_types_supported.
  • CIMD draft-ietf-oauth-client-id-metadata-document-03: AttestoPhoenix.ClientIdMetadata.auth_methods/1, supported_by_server?/2, transient_error?/1 and prefetch_logo/3. prefetch_logo/3 fetches a logo_uri through the same address screening as the metadata document and accepts PNG, JPEG, GIF and WebP whose bytes match the declared type; it needs the optional :req dependency.
  • AttestoPhoenix.Plug.CORS, for a host that mounts its own protected routes and wants the same CORS policy on them.

[4.16.0] - 2026-11-14

Requires attesto >= 2.20.0 (was >= 2.19.0).

Security

  • AttestoPhoenix.Plug.Authenticate and AttestoPhoenix.ProtectedResource no longer fall back to the request Host header for DPoP htu verification: bundled /userinfo, /credential, and /deferred_credential endpoints use their configured endpoint URLs, AttestoPhoenix.Config.new/1 defaults :resource_origin to the origin of :audience when neither :resource_origin nor :htu is set with DPoP enabled, Authenticate.init/1 refuses DPoP mounts with no pinned target URI and refuses malformed :htu options, and a nil return from a :htu callback refuses DPoP requests with invalid_dpop_proof across both protected resources and authorization-server DPoP endpoints (/token, /par, /device_authorization) instead of falling back to Host or crashing.
  • Pairwise clients now receive the derived pairwise sub in access tokens with the host subject sealed via Attesto.PairwiseSubject. Sector identifier derivation rejects non-https and loopback redirect URIs, and dynamic registration, SubjectIdentifier, and the token endpoint allow only authorization_code and refresh_token grant types for pairwise clients (refusing device_code, ciba, jwt-bearer, token-exchange, pre-authorized_code, and client_credentials).
  • AttestoPhoenix.Revocation now revokes unconsumed pending and approved device codes, CIBA requests, and pre-authorized codes on subject, client, and session (:sid) revocation across both ETS and Ecto stores.
  • Parked authorization interactions now use a dedicated ETS table bounded by :interaction_max_entries (default 8_192), Interaction.park/3 stores a fixed allowlist of 24 request parameters rather than arbitrary keys, and :par_max_record_bytes is enforced in Interaction.park/3 across all stores and in the bundled Ecto PAR store's put/3.
  • AuthorizationServer.Authorize applies require_nonce after scope narrowing against the host policy's effective scope, so a request with no scope and no nonce is refused when the default scope contains "openid".
  • URLComparison no longer treats a percent-encoded host as equal to its decoded form.
  • CIBA refuses C1 control characters in binding/display text.
  • Verifier caps JWE protected headers at 16 KiB.

Breaking

  • AttestoPhoenix.Config.new/1 defaults :resource_origin to the origin of :audience when DPoP is enabled and neither :resource_origin nor :htu is set; hosts serving protected resources at another origin must set :resource_origin (or :htu).
  • AttestoPhoenix.Config.new/1 validates :trusted_proxies at boot and raises ArgumentError on 0.0.0.0/0, entries with host bits set, and malformed entries; {network, prefix} CIDR tuples are accepted alongside CIDR strings, IP tuples, :any, and :loopback.
  • AttestoPhoenix.Plug.Authenticate.init/1 raises ArgumentError on malformed :htu options or when DPoP is enabled with no pinned :resource_origin, :htu, or route :origin.
  • Pairwise access tokens carry the derived pairwise sub and the sealed "attesto.pairwise_subject" claim; resource servers validating tokens directly require :pairwise_subject_salt. Pairwise clients with any grant type other than authorization_code or refresh_token are refused.
  • Parked authorization requests keep only the 24 listed request parameters; custom host parameters are no longer visible on resume.
  • AttestoPhoenix.Revocation.revoke/2 raises when a configured device-code, CIBA, or pre-authorized-code store lacks delete_unconsumed/1, and returns three additional revocation counts in its summary.

Added

[4.15.2] - 2026-11-13

Fixed

  • A Deny recorded with Interaction.decide/4 is answered access_denied (consent_required under prompt=none) as soon as the resumed request is validated, before the host's :authenticate_resource_owner and :consent run. Before, a request with max_age whose session went stale while the End-User was on the consent page sent them to sign in after they clicked Deny, then showed the consent page again, and the client never received access_denied. Refusing grants nothing, so it needs no fresh authentication; only the parking browser, for the parked subject, can record a decision. A recorded Allow still goes through authentication and the host's :consent.

[4.15.1] - 2026-11-13

Fixed

  • Interaction.decide/4 refused every consent decision from a page served on an origin other than the issuer's, such as a development server on http://localhost:4000 with an https://localhost issuer, or a deployment reachable on a second host. A named Origin may now also be the origin the request reached, computed by RequestContext.canonical_url/2, which honors forwarded headers only from :trusted_proxies. This is the test Phoenix's check_origin: :conn applies; a cross-site page cannot make a browser send an Origin matching the Host it posts to.

[4.15.0] - 2026-11-13

Requires attesto >= 2.19.0 (was >= 2.18.0).

Fixed

  • Authorization responses no longer duplicate a parameter already in the registered redirect_uri. A registered https://client.example/cb?state=static produced ?state=static&state=abc123&code=..., and first-value parsers read the registered state, so the client's state check failed on success and on errors such as access_denied. A registered pair named code, state, iss, error, error_description, error_uri, session_state or response is now dropped before the response parameters are added, whether or not this response sets it; every other registered pair is kept byte for byte (RFC 6749 §3.1.2). The query is built by Attesto.URI.put_query_params/3, which the end-session and front-channel logout redirects also use.

[4.14.1] - 2026-11-13

Fixed

  • Interaction.decide/4 refused every consent decision posted from a page with Referrer-Policy: no-referrer. Browsers send Origin: null on a same-origin form POST from such a page (Fetch, "append a request Origin header"), and 4.14.0 treated null as a foreign origin. Origin: null is now not refused on its own; Sec-Fetch-Site other than same-origin, an Origin naming another origin, and the resume id as the form's synchronizer token still apply.
  • Interaction.decide/4 raised ArgumentError when the browser had no binding value, for example a browser that never parked a request or lost its session. It now returns {:error, :invalid_resume}, as take/3 does. It still raises when :interaction_browser_binding is not configured.

[4.14.0] - 2026-11-13

Added

  • AttestoPhoenix.Interaction.park/3 accepts subject: to bind a consent page to the authenticated OIDC sub and validated request. Interaction.decide/4 records Allow/Deny on that single-use, browser-bound parked entry, and Interaction.consent_decision/3 returns it on resume only for the same subject and consent binding, including the effective scope. Hosts can keep consent decisions without a separate table or consent grant; the host's POST handler records the decision and redirects with resume only. Re-parking clears the decision. The resume id in the consent form is the page's synchronizer token, and decide/4 returns {:error, :cross_origin} before reading the store when Sec-Fetch-Site is present and not same-origin, or Origin is present and is not the issuer's origin. The Interaction moduledoc explains why the handler cannot rely on :protect_from_forgery for a page rendered from :consent (the authorization endpoint must accept cross-site POST, OIDC Core §3.1.2.1).
  • Optional AttestoPhoenix.PARStore.replace/2, implemented atomically by the bundled ETS and Ecto stores, updates a live entry without extending expiry or recreating an entry removed by take/1. It is needed only for Interaction.decide/4; existing park/resume hosts need no changes or migration.

Documentation

  • Interaction.BrowserBinding: a lost binding no longer spends the parked request (since 4.13.0); it can no longer be found by any browser and expires with :interaction_ttl.

[4.13.0] - 2026-11-13

Added

  • :authenticate_resource_owner and :consent may return {:error, :server_error} or {:error, :temporarily_unavailable} when the host itself fails, for example when AttestoPhoenix.Interaction.park/2 cannot store the request. The client receives that RFC 6749 §4.1.2.1 code by redirect, under prompt=none too; no host text is sent. Before, a host could reach server_error only by returning an invalid result, which was logged as a contract violation, and could not answer temporarily_unavailable at all. The Interaction and ConsentGrant examples now handle a failed park this way.

Security

  • A resume from the wrong browser no longer uses up the parked request. Interaction.take/3 removed the entry from the store before it compared browser bindings, so anyone holding a leaked resume id (from browser history, a Referer header or a request log) and any binding of their own, which any prompt=login flow on a public client hands out, could spend the victim's parked request and leave their sign-in on an error page. They got no token, session or request data from it. A parked request is now stored under a key derived from the resume id and the browser binding hash, so a lookup from another browser finds nothing and the browser that parked the request can still resume it. The :par_store contract is unchanged: atomic take/1 is still all it needs.

Upgrading

  • Requests parked by 4.12.x or earlier are stored under the old key and cannot be resumed after the upgrade. A browser mid-sign-in at deploy time gets the invalid-resume error page and starts the authorization again. Old entries expire after :interaction_ttl (default 600 seconds).

[4.12.0] - 2026-11-12

Fixed

  • A fresh prompt=login request first parked in consent retains the exact authentication bound it already passed: arrival minus the 60-second allowance. Resume adds no allowance to that bound. A login detour still requires auth_time >= parked_at, and re-parking keeps the first bound. parked_at remains the real first park time for max_age; its behavior is unchanged (OIDC Core §3.1.2.1, §3.1.2.3).

Added

  • AttestoPhoenix.Interaction.BrowserBinding puts a random 32-byte secret in the fetched session if absent; binding/1 reads it for :interaction_browser_binding. Mount before the authorize route and keep the value through login. Session renewal with renew: true keeps session data; drop: true discards it. A lost binding causes the wrong-browser refusal and spends the parked request.
  • Consent grant examples keep the token in the browser's session, mint with the saved authorization parameters and scope: request.scope, and consume in :consent on resume. A resume URL carries no other parameter. The non-resume token pattern remains documented.
  • auth_opts.prompt_login_since exposes the earliest acceptable prompt=login authentication time on resume, separately from parked_at.

Upgrading from 4.10

Return :auth_time (Unix seconds) from :authenticate_resource_owner. Send the browser to login when auth_opts.force_reauth is true or the existing authentication exceeds auth_opts.max_age, and return the new authentication time (OIDC Core §3.1.2.1, §3.1.2.3). Use park/resume to keep the request across login and consent; on resume, check the recorded authentication bounds before reusing the login.

[4.11.1] - 2026-11-12

Fixed

  • ConsentGrant.binding_from_params/3 and safe_binding_from_params/3 take scope:, the scope the scope policy decided, which the :consent callback receives as request.scope. binding/2 hashes that scope; the params builders hashed the raw scope parameter. Since 4.11.0 a request without scope, with an empty one, or pushed without one reaches :consent with the policy's default, so a consent grant minted from the consent screen's parameters never matched and the consent screen repeated. The same mismatch applied when the policy narrowed a requested scope. Pass scope: request.scope when minting; without it the builders behave as before.

[4.11.0] - 2026-11-12

Breaking

  • Authorization requests with prompt=login now require the host's auth_time to be at or after the parked request's time, or no more than 60 seconds before a fresh request arrived. Missing, stale, or invalid authentication is logged and returned as server_error, like an interactive max_age contract failure (OpenID Connect Core §3.1.2.1, §3.1.2.3). Hosts receive auth_opts.parked_at.
  • Requires attesto >= 2.18.0 and < 3.0.0 for the shared freshness check and optional refresh-family lock callback.

Fixed

  • An authorization request without scope is processed with the scope the scope policy returns, as RFC 6749 §3.3 allows ("process the request using a pre-defined default value"). Since 4.7.0 the authorization endpoint treated any scope the request did not name as the policy adding scope, and answered invalid_scope; the token endpoint already made this exception. Both now use ScopeAuthorization.within_request?/2. On such a request :consent receives the policy's default scope in request.scope, not []; a host that binds a consent record to the request binds it to that scope.

  • Scheduled clustered sweeps hold one session advisory lock on a checked-out connection and commit each redaction or table deletion separately. This removes the refresh-row/authorization-code lock inversion with revocation. The lock is released on completion or error, or when a crashed connection closes. sweep_once/2 still participates in the caller's transaction.

  • Bulk refresh revocation sorts family identifiers. Redaction takes the same family locks in that order, then locks affected rows in family/id order before updating. Family deletion also locks rows by id. Store behaviours and AttestoPhoenix.Revocation document the shared lock order.

  • Grace-window refresh recovery rechecks the family under the rotation lock. Configured :refresh_completion callbacks run under that lock, including retries; rolled-back work cannot return a token. A token minted immediately before revocation commits may still reach the client; host transaction integration remains necessary for host eligibility checks (RFC 9700 §4.14.2; RFC 7009 §2.1).

  • Both discovery documents derive request_parameter_supported and request_uri_parameter_supported from one function, including explicit false values when unsupported (OpenID Connect Discovery §3; RFC 8414 §2).

Added

  • Optional :render_end_session_error callback, validated at boot with two arguments: the connection and an OAuthError containing library-owned code, description, and status. Request parameters are never copied into the error. The default HTML/JSON responses are unchanged (RP-Initiated Logout §4).

  • AttestoPhoenix.Interaction.request_params/1 returns the parked parameters on resume, or the request's query and parsed body parameters otherwise. PAR retains its front-channel request_uri and resolves it again on resume (RFC 9126 §2.3).

  • AttestoPhoenix.Interaction.reauthentication_allowance_seconds/0 exposes the 60-second allowance used by the controller for interactive max_age and fresh prompt=login requests (OpenID Connect Core §3.1.2.1, §3.1.2.3).

  • Router options registration_read: false and registration_update: false omit GET and PUT /oauth/register/:client_id independently. Both default to true when registration is mounted (RFC 7592 §2.1, §2.2).

  • A consent callback example using the existing Interaction.park/2 and resume flow (OpenID Connect Core §3.1.2.4).

Changed

  • Credential Response metadata advertises outbound DEF compression; the issuer compresses encrypted responses only when the wallet explicitly requests it. Compressed inbound requests remain refused.

  • Parking a resumed request for consent now retains the original parameters and first park time. prompt=login still requires authentication at or after that original park (OpenID Connect Core §3.1.2.1, §3.1.2.3).

  • Mounted registration read/update routes without their required host callbacks now return 405 Method Not Allowed to an authenticated client, with an empty body and Allow listing the configured, mounted methods at that client resource. Previously they returned 400 invalid_client_metadata (RFC 7592 §2.1, §2.2; RFC 9110 §15.5.6, §10.2.1).

[4.10.0] - 2026-11-12

Requires attesto >= 2.17.0 and < 3.0.0.

Added

  • Digital Credentials API presentation requests and encrypted dc_api.jwt responses (OpenID4VP 1.0 §§A.1–A.4, B.2.6.2). The host configures its page origin at boot. Signed requests include expected_origins; each stored session records its flow and refuses responses from another flow or origin. The page posts the returned response to a session-specific endpoint, using the existing response decryption and single-use result handling. Plain dc_api is not offered because HAIP 1.0 §5.2 requires dc_api.jwt. Redirect presentations remain the default.
  • :verifier_accepted_algs to opt into ES384/P-384 and ES512/P-521 mdoc issuer signatures through core's :accepted_algs. The default mdoc policy remains ES256-only. Requests advertise the configured issuer algorithms; device authentication is unchanged (HAIP 1.0 §7).

[4.9.0] - 2026-11-12

Requires attesto >= 2.16.0 and < 3.0.0.

Added

  • Verifier issuer trust anchors for SD-JWT VC and mdoc presentations, with an optional host certificate policy and HAIP checks enabled by default. Core validates certificate paths (RFC 5280 §6), binds SD-JWT VC leaves to iss using its SAN policy (SD-JWT VC draft-08 §3.5), and validates mdoc issuerAuth chains for the document-signer purpose (ISO 18013-5 §§9.1.2.4, 9.3.1). The default HAIP mode refuses self-signed leaves and embedded trust anchors (HAIP 1.0 §6.1.1 specifies these restrictions for SD-JWT VC; ISO 18013-5 Annex B.1.1 excludes the mdoc trust anchor). Anchors and issuer keys or resolvers are mutually exclusive; certificate failures never fall back to issuer keys.

Changed

  • Require attesto >= 2.16.0 and < 3.0.0; update the minimum-consumer dependency and CI core revision to 2.16.0.

[4.8.0] - 2026-11-12

Requires attesto >= 2.14.0.

Changed

  • Access tokens are refused unless their JOSE header typ is the configured at+jwt (RFC 9068 §4), at every endpoint that verifies one: UserInfo, introspection, the protected-resource plug, token exchange. The rule is core's Attesto.Token.verify/3; see the attesto 2.14.0 changelog. Tokens this server mints have always carried the header.

  • A server with no way to resolve client keys (no :client_jwks callback and no :client_store providing one) answers a request parameter with request_not_supported (OIDC Core §3.1.2.6) at the authorization and PAR endpoints. It used to answer invalid_request_object. Such a server already advertises request_parameter_supported: false. A server that does support request objects still answers invalid_request_object for a client that has no usable keys, and a Client ID Metadata Document client that carries its own keys is still served.

  • A request parameter sent more than once is answered invalid_request at both endpoints (RFC 6749 §3.1). It used to be ignored.

  • Dynamic registration validates response_types (RFC 7591 §2). The member used to be dropped: it was neither checked, stored, nor returned. It must now be a list of distinct strings drawn from the response types the authorization endpoint supports (code), and it must agree with grant_types: code goes with authorization_code. An absent member defaults to ["code"] for an authorization_code client and is left out for a client with no authorization-endpoint grant. The validated value is passed to :register_client / :update_client and returned.

    Behaviour change: a registration that names an unsupported response type (token, id_token, a hybrid) or a pair that cannot work is refused with invalid_client_metadata where it used to succeed, and the attributes handed to :register_client gain a "response_types" member.

  • The registration response describes the client as stored (RFC 7591 §3.2.1). When :client_registration_metadata is configured, the metadata in a registration or update response is read back from the client that :register_client or :update_client returned, so a host that narrows scopes or grant types answers with what it kept. The response used to repeat the request. client_id, client_id_issued_at, the plaintext credentials and the management URI still come from issuance, and a stored value cannot replace them. Without the callback the response is unchanged.

Added

  • :render_authorization_error, (conn, %AttestoPhoenix.OAuthError{} -> conn), renders every authorization-endpoint error that cannot be redirected: an unknown client, a missing, invalid or unregistered redirect_uri, an unknown or expired request_uri, a refused resume, a request over plain HTTP, a refused embedded user agent. The error carries the OAuth code, the library's own reason text and status 400, and no request parameter. Unset, the built-in page is rendered as before. A callback that does not send a response is logged and the built-in page is rendered.
  • :register_client and :update_client can choose the refusal the client sees. {:error, {:unavailable, retry_after_seconds}} answers 503 with Retry-After (RFC 9110 §15.6.4), for a host that limits registrations by count or rate. {:error, %AttestoPhoenix.OAuthError{}} with a 4xx status is sent as given. Any other refusal is 400 invalid_client_metadata as before, and an OAuthError with a status outside 4xx is answered that way too and logged, so a host fault cannot put a 5xx body on the wire.

[4.7.1] - 2026-11-11

Fixed

  • mix attesto_phoenix.install no longer refuses a freshly generated Phoenix application. mix phx.new writes config :my_app, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY") inside if config_env() == :prod in config/runtime.exs, and the installer stopped with "could not determine configured :schema_prefix expression nested config expression ...". The check that looks for conditional AttestoPhoenix.Config settings treated every nested config call with a literal atom key as possibly being that configuration. A literal atom key names an ordinary application setting and is no longer treated as ambiguous. Conditional AttestoPhoenix.Config settings, and keys the installer cannot resolve (variables, unknown aliases), are still refused.

[4.7.0] - 2026-11-11

Requires attesto >= 2.13.0.

Changed

  • The authorization endpoint enforces max_age (OIDC Core §3.1.2.1). Until now the auth_time returned by :authenticate_resource_owner was copied into the code without being compared to the request's max_age, and a missing auth_time was only logged. The rule is Attesto.AuthorizationRequest.check_auth_time/4; the controller maps its result:

    • Under prompt=none, an authentication older than max_age is answered with a login_required redirect (§3.1.2.6).
    • On an interactive request, an authentication older than max_age means the host did not re-authenticate as auth_opts.max_age told it to. The client cannot correct that, so the answer is a server_error redirect and an error log line. The interactive check allows 60 seconds beyond max_age for the hop back from the host's login page, so max_age=0 works with a host that re-authenticates and returns.
    • When max_age was requested and the host returns no auth_time, or one that is malformed or in the future, the answer is server_error under either prompt. §3.1.2.1 says the ID Token MUST include auth_time in that case, so no code is issued without one.

    Behaviour change: a host whose :authenticate_resource_owner ignores auth_opts.max_age, or returns no auth_time, now gets an error redirect for requests that carry max_age where it used to get a code. Return the time of the End-User's last active authentication as :auth_time, and re-authenticate when it is older than auth_opts.max_age. Requests without max_age are unaffected.

  • The scope policy (:authorize_scope / :scope_policy) runs at the authorization endpoint, after request validation and before :authenticate_resource_owner. Until now it ran only at the token endpoint, so a scope the policy refuses got a code and failed at redemption. A refusal is answered with a redirectable invalid_scope (RFC 6749 §4.1.2.1), under prompt=none too. A scope the policy narrows is what :consent sees and what the code is bound to. Both endpoints decide through AttestoPhoenix.AuthorizationServer.ScopeAuthorization.authorize/4.

    Behaviour change: with no :authorize_scope and no :scope_policy, the built-in policy accepts only scopes in the effective :scopes_supported catalog, and it now refuses the rest at the authorization endpoint. A deployment that never set a catalog or a policy and relied on getting a code for an unlisted scope sets :scopes_supported or supplies a policy.

  • At the token endpoint the request's resource indicators are resolved before the scope policy runs, so the policy can receive them. A token request with both an invalid resource and a refused scope is now answered invalid_target where it used to be answered invalid_scope.

  • form_post is in the default :response_modes_supported, so both discovery documents now advertise it and the authorization and PAR endpoints accept it (see Added). A deployment that must not offer it sets :response_modes_supported without it.

  • A form_post.jwt response is sent with Cache-Control: no-store.

Fixed

  • :token_issued events carry the resource-owner :subject. The event documentation described the field, but it was always nil on this event. It is now the redeemed grant's subject for the authorization-code, device, CIBA, pre-authorized-code and jwt-bearer grants, and the subject token's sub for token exchange. It stays nil for client_credentials, which has no resource owner. :refresh_issued and :refresh_rotated already carried it.

Added

  • AttestoPhoenix.Interaction.park/2 stores the authorization request being processed and returns a resume_id; sending the browser to the authorization endpoint with ?resume=<resume_id> and nothing else resumes it. A host uses it to get back to a request after its login page (prompt=login, max_age, no session). A resume re-runs the parked parameters through the whole pipeline (client load, validation, scope policy), and :authenticate_resource_owner receives auth_opts.resumed: true; auth_opts now always carries :resumed. A parked request resumes once, within :interaction_ttl seconds (default 600, at most 3600), and only from the browser whose :interaction_browser_binding value matches. resume with any other parameter, or an unknown, expired, used or wrong-browser resume, is a direct error page. Parked requests are kept in :par_store (which needs take/1) under keys no request_uri can have, so there is no new table and the existing expiry applies.
  • On a resumed request with max_age, an authentication made after the request was parked satisfies max_age, and an earlier one is checked exactly. The 60-second interval a fresh interactive request gets does not apply to a resume.
  • Pairwise subject identifiers (OpenID Connect Core §8.1). :client_subject_type ((client -> "public" | "pairwise"), also an optional AttestoPhoenix.ClientStore callback) and :pairwise_subject_salt (at least 32 bytes, required once the callback is configured). A pairwise client is shown Attesto.PairwiseSubject.derive/3 of its sector identifier, the host subject and the salt as sub in its ID Tokens, UserInfo responses, introspection responses (by caller) and back-channel logout tokens; AttestoPhoenix.AuthorizationServer.SubjectIdentifier is the one place that decides. Access tokens keep the host subject. The sector identifier is the one host the client's redirect URIs share; sector_identifier_uri is not supported, and a pairwise client whose redirect URIs span hosts is refused at registration and wherever a sub would be issued. Discovery advertises subject_types_supported: ["public", "pairwise"] once the callback is configured. For a pairwise client, the :terminate_session context's :subject (taken from the id_token_hint) is the pairwise value.
  • Signed UserInfo responses (OpenID Connect Core §5.3.2). :client_userinfo_signed_response_alg ((client -> alg | nil), also an optional AttestoPhoenix.ClientStore callback) makes the UserInfo endpoint answer that client with a JWT (application/jwt) signed with the current signing key and carrying iss and aud. Discovery then advertises userinfo_signing_alg_values_supported. A client registered for an algorithm this server does not sign with gets a 500, never unsigned claims. Encrypted UserInfo responses are not implemented.
  • Dynamic registration accepts subject_type and userinfo_signed_response_alg (OpenID Connect Dynamic Client Registration 1.0 §2) when this server supports the requested value, and refuses sector_identifier_uri.
  • RFC 7592 client read and update: GET and PUT on /oauth/register/:client_id, mounted with registration: true and authorized by the registration access token through the check DELETE uses (Registration.authorize_management/3). GET needs the new :client_registration_metadata callback and PUT also :update_client (both optional AttestoPhoenix.RegistrationStore callbacks); without them the request fails closed. An update is the client's complete new metadata, validated by the registration rules, with the RFC 7592 §2.2 member rules: client_id must match, registration_access_token, registration_client_uri, client_secret_expires_at and client_id_issued_at must be absent, and a client_secret must be the current one. token_endpoint_auth_method and subject_type cannot be changed, and a pairwise client's redirect URIs must stay on its host. Neither the registration access token nor the client secret is rotated; responses echo the presented token and never include client_secret. A successful update emits a :client_updated event.
  • response_mode=form_post (OAuth 2.0 Form Post Response Mode). The authorization response, success or redirectable error, is rendered as an auto-submitting HTML form that POSTs the parameters to the redirect URI, so none of them appears in a URL. Names and values are HTML-escaped, the page is sent with Cache-Control: no-store, and the RFC 9207 iss parameter is included as it is for query. It uses the form renderer form_post.jwt already had. A redirect URI that is not http or https cannot be a form action and is answered 400, as for form_post.jwt.
  • :authorization_code_issuance wraps authorization-code issuance at the authorization endpoint in a host callback, (context, continuation), with context %{client_id, subject, family_id, private_context}. The host runs the continuation inside its own transaction and locks, so the code is stored atomically with a session or eligibility check, or refuses with an AttestoPhoenix.OAuthError: access_denied, server_error or temporarily_unavailable are redirected as named, and login_required only for a prompt=none request. Unset, issuance is unchanged.
  • :refresh_completion wraps the refresh grant in a host callback, (context, continuation), with context %{client_id, subject, family_id, scope, resource, auth_time, acr, sid} read from the stored grant. Rotation of the presented refresh token happens inside the continuation. A host that refuses with invalid_grant before invoking it has not consumed the token, and with AttestoPhoenix.Store.EctoRefreshStore on the host's repo a rollback of the host's transaction undoes the rotation. A refresh store that is not transactional with the host cannot be rolled back once the continuation has run. A family revocation from reuse detection, or from a :build_refresh_principal denial, is applied again after the callback returns, so a host rollback does not undo it. Unset, the refresh grant runs in the order it always has.
  • AttestoPhoenix.AuthorizationServer.Continuation holds the contract the three continuation hooks share: one invocation, in the callback's process, with the continuation's result returned unchanged and verified by digest. :authorization_code_completion now runs through it; its behavior and log lines are unchanged.
  • The scope policy has a three-argument form, authorize_scope(client, requested_scope, resources), which also receives the request's resolved RFC 8707 resource indicators. It is used when the :authorize_scope callback has that arity or the :scope_policy module exports it, and is called with the same arguments at the authorization and token endpoints. It may answer {:error, :invalid_target} (RFC 8707 §2) for a refusal about a resource or a resource-and-scope combination; the two-argument form may answer only {:error, :invalid_scope}. A :scope_policy module may export either form or both.
  • AttestoPhoenix.Revocation.revoke_subject/2, revoke_client/2 and revoke_session/2 (and the general revoke/2) delete the unredeemed authorization codes and revoke the refresh-token families of a subject, a client or a host session, and return {:ok, %{codes: n, refresh_families: m}}. With the bundled Ecto stores they run on the configured repo, so a call inside the host's transaction commits or rolls back with it. Access tokens already issued are not revoked: a self-contained JWT access token stays valid until it expires unless the protected resource consults introspection or a denylist.
  • AttestoPhoenix.Store.EctoCodeStore.delete_unconsumed/1 and AttestoPhoenix.Store.EctoRefreshStore.revoke_families/1 implement the new optional core store callbacks. Both select by :subject, :client_id and/or :sid. The session identifier is matched inside the existing claims JSONB column, so there is no new column and no migration; a selection by :sid alone scans the table's live rows.
  • AttestoPhoenix.Store.Sweeper.sweep_once/2 runs one deletion pass over the Attesto tables with a caller-supplied now and returns the per-table counts. It opens no transaction, so it runs inside the caller's. It is the pass the supervised process runs. Back-channel logout retries are not part of it, because they make network calls; the supervised process keeps doing those.
  • AttestoPhoenix.Store.Sweeper takes cluster_lock: {:advisory, key}. Each scheduled deletion pass then runs in a transaction that first takes the PostgreSQL advisory lock key with pg_try_advisory_xact_lock, so with the same key on every node one node sweeps per interval and the others skip it. sweep_now/0,1 returns :skipped for a skipped pass.
  • attesto_routes/1 takes par:, revocation: and introspection:, each defaulting to true. false leaves the route unmounted, and both the RFC 8414 and the OpenID Provider metadata documents then omit that endpoint and its *_auth_methods_supported and signing-algorithm members. Both documents read the omitted routes from AttestoPhoenix.RouteControls. par: false with require_pushed_authorization_requests: true raises ArgumentError on the metadata and authorization routes at request time; the router options are compile-time and the configuration is per request, so the conflict is not visible at boot.
  • :userinfo_scope_claims (a map from scope to extra claim names) and :userinfo_always_claims (claim names released for every openid token) widen what the UserInfo endpoint releases beyond the OIDC Core §5.4 set. A standard scope gains the listed names; a host-defined scope gets them as its whole set. Neither may name sub. When :claims_supported is non-empty, every configured name must appear in it.
  • :build_userinfo_claims may return {:error, :invalid_token} to refuse a subject, for example one disabled after its access token was minted. The UserInfo endpoint answers 401 with the same RFC 6750 §3.1 invalid_token challenge a rejected token gets.
  • :on_invalid_id_token_hint sets what the end-session endpoint does with an id_token_hint that fails verification. :reject (the default) answers 400, as before. :terminate_session runs the :terminate_session callback with %{subject: nil, sid: nil, client_id: nil, hint: :invalid} so the host can ask the End-User whether to log out (RP-Initiated Logout 1.0 §2, §4). Nothing from the failed hint is used, and post_logout_redirect_uri is never honored for such a request.
  • The :terminate_session context carries :hint: :verified, :absent or :invalid.
  • The :authorization_code_private_context callback's context also carries :authentication (the subject map the host's authentication and consent callbacks returned, including :auth_time and :sid when the host set them), and the validated request's :scope and :resource. :subject is still the subject id string. A callback that matched the context with map_size/1 or an exact-map comparison has three more keys to allow for.
  • :response_modes_supported sets the authorization response modes this server accepts and advertises: a non-empty list drawn from Attesto.AuthorizationRequest.supported_response_modes/0, which stays the default. An authorization or pushed request for a mode outside the list is answered with a redirectable invalid_request, and both discovery documents advertise the configured list in response_modes_supported. A request with no response_mode asks for query, so leaving "query" out makes an explicit JARM mode mandatory.
  • The validated request passed to :authenticate_resource_owner and :consent carries id_token_hint and login_hint (OIDC Core §3.1.2.1), including for a request that arrived through PAR.
  • :id_token_ttl sets the ID Token lifetime in seconds. It must be a positive integer no greater than Attesto.IDToken.max_lifetime_seconds/0 (3600), and defaults to 3600, the lifetime ID Tokens had before. It applies to every ID Token this server mints, including those from the CIBA grant.
  • :id_token_azp controls the azp claim on minted ID Tokens. :never (the default) omits it, as before. :always sets it to the client the ID Token is issued to. OIDC Core §2 makes azp OPTIONAL and says implementations not using extensions "are encouraged to not use azp"; :always runs against that encouragement and exists for relying parties that check azp on a single-audience ID Token. azp could not be added through :build_id_token_claims, because it is a reserved claim.

[4.6.0] - 2026-11-09

Security

  • Add the :resource_origin configuration key: the external https origin clients address this configuration's protected resources by, such as "https://api.example.com". When it is set, the DPoP target URI (htu) a proof must sign at a protected resource is that origin followed by the request path. This covers AttestoPhoenix.Plug.Authenticate, the bundled UserInfo and credential endpoints, and AttestoPhoenix.DPoP.Adapter.protected_resource_opts/1, which attesto_mcp_server's Phoenix integration uses. Until now the protected-resource htu was always rebuilt from the request Host header (or the forwarded host from a trusted proxy) unless the host wrote an :htu callback, and Attesto core's :origin could not be used on this path because the adapter already supplied :htu. This applies only when DPoP is enabled and the server answers more than one Host: such a server accepted a DPoP-bound access token together with a proof made for another server when the sender named that server in Host (RFC 9449 §4.3).

    To pin the origin, add resource_origin: "https://api.example.com" (the origin of your protected resources) to config :my_app, AttestoPhoenix.Config or to the options given to AttestoPhoenix.Config.new/1. It is not the issuer: the authorization server may live on another origin, and :issuer is not consulted. When the bundled UserInfo or credential endpoints are served on a different origin than the host's own resources, set :htu instead, or pin each route with plug AttestoPhoenix.Plug.Authenticate, origin: "...". :resource_origin must be an https URL with a host, an optional port, and no path, userinfo, query, or fragment, and AttestoPhoenix.Config.new/1 raises when it is combined with :htu.

    Behaviour change: none until :resource_origin is set. Without it the protected-resource htu is still derived from the request, so a server that answers more than one Host stays exposed until the key (or :htu) is configured. Once it is set, a proof signed for any other origin, including an alias hostname that reaches the same deployment, is refused.

Fixed

  • AttestoPhoenix.Plug.Authenticate accepts Attesto core's :origin as a per-plug option. The adapter's :htu callback was merged alongside it, and Attesto.Plug.Authenticate.init/1 raised ArgumentError for the pair, so every request on that route failed. A per-plug :origin now replaces the configured htu derivation for that route.

Added

[4.5.0] - 2026-11-09

Security

  • Require Attesto >= 2.12.0 and < 3.0.0. Attesto 2.12.0 keeps the full grant on a rotated refresh token, which the refresh changes below depend on, and refuses a JWK Set where one JWK is expected.
  • Honour the OpenID Connect claims request parameter only when :claims_parameter_supported is true. With the default false, the authorization endpoint still recorded the parameter on the code, and UserInfo released every claim named in its userinfo member that :build_userinfo_claims returned, whatever the granted scopes, so a client granted only openid could read any claim the host callback supplied. With false, the authorization endpoint no longer records the parameter, the :build_id_token_claims and :build_userinfo_claims callbacks receive no requested claims from it, and UserInfo ignores a claims object already on an access token, including tokens refreshed from earlier codes. A host that relies on the parameter sets claims_parameter_supported: true, which also advertises it in OpenID Provider Metadata.
  • Bind consent grants to the request's RFC 9396 authorization_details. AttestoPhoenix.ConsentGrant.binding/2, binding_from_params/2 and binding_hash/1 ignored the field, so a grant minted for a request without authorization details could be consumed for an otherwise identical request that named an OID4VCI openid_credential configuration, and the issued access token carried that credential entitlement. The binding now carries authorization_details in request order, and binding_from_params/2 reads it as a JSON array string or a decoded list. A request without authorization details hashes as before, so in-flight grants for such requests still consume after the upgrade.
  • Keep successfully redeemed authorization-code rows until their replay_retain_until family deadline when :refresh_store does not persist through EctoRefreshStore. Store.Sweeper decided retention for those rows only from the bundled refresh-token table, which such a store never writes, so it deleted them once the code and its access token expired. A later replay of the code then looked unknown and the refresh family was not revoked. With a refresh store that keeps families elsewhere, a row is now kept until the deadline, indefinitely when :refresh_token_max_lifetime is unset. Retention with EctoRefreshStore or an unset :refresh_store is unchanged.

Fixed

  • Return 400 invalid_request from the token endpoint for any unsupported Content-Type. TokenController copied the header value into error_description, so a value with invalid UTF-8 (for example text/\xFF) made the JSON error body unencodable and an unauthenticated request got a 500. The value is now echoed only when it is a syntactically valid media type; otherwise the description is unsupported token request Content-Type.
  • Stop request strings that PostgreSQL text cannot hold from reaching the Ecto stores. A NUL byte (or invalid UTF-8) raised Postgrex.Error 22021 out of EctoNonceStore.valid?/1,2 and accept/2,3 (a DPoP proof nonce or attestation challenge, unauthenticated), EctoPARStore.fetch/1 and take/1 (/authorize?request_uri=...%00, unauthenticated) and EctoConsentGrantStore.consume/2. These now return their not-found result without a query: false, {:error, :unknown}, :error and {:error, :not_found}, so the endpoints answer use_dpop_nonce and invalid_request_uri. EctoPARStore.put/3 also returns {:error, :invalid_text} for such a request_uri.
  • Reject a CIBA acr_values entry that contains a control character or is longer than 255 bytes with invalid_request. Such an entry raised Postgrex.Error when EctoCIBAStore inserted it into its 255-character array column.
  • Refuse a Client ID Metadata Document whose grant_types contains an empty string as :invalid_metadata. ClientIdMetadata.Resolver accepted it, and the token endpoint's per-client grant check then raised ArgumentError for every token request naming that client_id. The client is now rejected as invalid_client, and such a document is neither cached nor accepted from a cache.
  • Accept a pushed authorization request that carries no client_id in its body when the client authenticated by other means (for example HTTP Basic or client_assertion). AuthorizationServer.PAR validated the request before supplying the authenticated client_id, so the push failed with invalid_request ("invalid_client_id"), although the code already meant to supply it. The authenticated identifier is now added before validation; a body client_id that differs from it is still rejected.
  • Answer prompt=consent with consent_required when no :consent callback is configured. For a confidential client the authorization endpoint issued a code with implicit consent, although OpenID Connect Core §3.1.2.1 requires an error when the provider cannot obtain consent. Requests without prompt=consent keep the implicit-consent behaviour.
  • Dial outbound targets whose host resolves only to IPv6. The SSRF screen pinned the IPv6 address, but the pinned connection was opened as IPv4, so Client ID Metadata documents, remote jwks_uri sets, back-channel logout and CIBA ping deliveries to such hosts always failed with %Mint.TransportError{reason: :nxdomain}. An IPv6 literal now opens an IPv6 socket.
  • Render the :invalid stage for an expired user_code on the device verification page. DeviceVerificationController rendered :prompt for any pending code, so the user was asked to confirm a request whose approval then failed as :invalid. The moduledoc already listed expired codes under :invalid.
  • Correct the RequestContext.client_ip/2 documentation. It said the left-most X-Forwarded-For entry is returned; the function returns the right-most entry, the one appended by the trusted proxy, and unwinds only that one hop. Behind a CDN and a trusted load balancer, emitted events such as :auth_denied therefore carry the CDN edge address. Behaviour is unchanged.
  • Document what POST /oauth/revoke revokes. The endpoint revokes refresh tokens and their families only. It answers 200 for a presented access token without revoking it, and revoking a refresh token leaves access tokens already issued from that family valid until they expire. The RevocationController and AuthorizationServer.Revocation docs and the README did not say so, and a client could read the 200 as a successful access-token revocation. Behaviour is unchanged.
  • Document what :refresh_token_rotation_grace_seconds (default 60) allows for a public client that refreshes without DPoP. Inside the window the previous refresh token is accepted on the public client_id alone, so a party that copied it before rotation receives the same successor and the family is not revoked until a presentation after the window. Behaviour is unchanged.
  • Document that the shared Client ID Metadata fetch budgets can be spent by unauthenticated requests naming fresh uncached client_id URLs. Admission is charged before the fetch, so 120 such requests in a minute (or 30 on one host) leave other uncached CIMD clients answered invalid_client until the window resets. The :client_id_metadata docs and FlowControl now say so and point at :allowed_hosts, the quota and cache settings, and upstream rate limiting. Behaviour is unchanged.
  • Keep the full grant on refresh tokens when a token request names a narrower scope or resource. A refresh request with a scope or resource subset stored that subset as the rotated refresh token's grant, so one down-scoped refresh permanently removed the other scopes, the other resources, and the scope-bound OID4VCI credential configurations from the family. The authorization-code and CIBA grants also bound the initial refresh token to a token-request resource subset; the device grant already kept the full set. RFC 6749 §6 requires a new refresh token's scope to be identical to the presented token's, RFC 8707 §2.2 binds a refresh token to the full original grant, and RFC 9396 §6.1 leaves the user's authorization unchanged by a token-request authorization_details subset. Refresh tokens now keep the full grant: the subset applies only to the access token issued for that request, and a later refresh can obtain the full scope, resources, and credential configurations again. A request outside the grant is still invalid_scope, invalid_target, or invalid_authorization_details. A lost-response retry inside :refresh_token_rotation_grace_seconds that names a different subset of the grant now receives the same successor instead of revoking the family; a retry from another client or DPoP key, or one asking for anything outside the grant, still revokes it. EctoRefreshStore.rotate/4 returns {:error, :invalid_rotation} for a child whose scope or resource set differs from its parent's. The :build_refresh_principal callback's :resource is the access token's effective resource set, as before.
  • Store client- and request-supplied values without a 255-character limit. The generated tables kept client_id, the scope, resource, and granted_scope lists, the refresh-token and CIBA acr, and the CIBA binding_message in varchar(255) columns, so a longer value made the Ecto stores raise Postgrex.Error 22001 and the request failed with a 500: /authorize for a Client ID Metadata Document client_id over 255 bytes (the resolver admits up to 2,048) or with a scope token over 255 characters, refresh-token issuance for such a client, device authorization, a CIBA request, and logout-session recording (where the failure was logged and the session was not recorded). A CIBA binding_message within the default 128-grapheme limit could exceed 255 characters, because one grapheme can span several. The fresh migration now creates these columns as text, and the lists as unbounded varchar[]. Existing installations must generate and apply the new migration: mix attesto_phoenix.gen.migration --upgrade 4.5 --repo MyApp.Repo, then mix ecto.migrate. PostgreSQL applies it without rewriting the tables, missing optional tables are skipped, 4.4 nodes work with the widened columns, and its rollback leaves them widened. Until it has run, such values still fail in the bundled stores. CIBA acr_values keep their 255-byte limit at the backchannel endpoint.

[4.4.1] - 2026-11-05

Security

  • Require Attesto >= 2.11.0 and < 3.0.0. Attesto 2.11.0 refuses a present JSON null where an omitted claim means "no restriction", including a "cnf": null access token that earlier releases could accept as an unbound bearer token under the Jason or Poison JOSE backend.

Changed

  • Verified claims carry JSON null as nil whichever JSON backend JOSE uses, following Attesto 2.11.0. Under JOSE's builtin OTP backend they previously carried :null, including in claims passed to host callbacks.

[4.4.0] - 2026-11-01

Security

  • Extend AttestoPhoenix.AuthorizationServer.JwtBearer replay TTL calculation so the jti replay claim covers exp - now + 1 across the full 60-second future iat clock-skew allowance (max_lifetime + 61) and does not clamp TTL to 300 seconds when assertion_max_lifetime_seconds: nil is configured.
  • Reject cnf-bound assertions in the direct AttestoPhoenix.AuthorizationServer.JwtBearer.authorize/3 helper before subject resolution or replay claiming, because authorize/3 carries no sender-constraint proof context (Token.issue/2 uses prepare/3 and verifies cnf.jkt against the request's DPoP proof).

Changed

  • Require Attesto >= 2.10.0 and < 3.0.0 for Attesto.StrictJSON.decode_value/2 and Attesto.URI.valid_port?/2.
  • Decode remote Client ID Metadata Documents (ClientIdMetadata.Resolver), remote CIMD and ID-JAG jwks_uri responses (ClientIdMetadata.JWKSResolver and AuthorizationServer.JwtBearer), and token-endpoint authorization_details (AuthorizationServer.Token) through Attesto.StrictJSON, rejecting duplicate JSON object member names and container nesting beyond 32 levels.
  • Reject fragments, empty trailing authority colons (https://host:/path), and malformed or out-of-range ports in AttestoPhoenix.ClientIdMetadata.same_origin_redirect_uri?/2, AttestoPhoenix.RedirectURIRegistration.valid?/2, and dynamic client registration URI metadata (Registration).

[4.3.1] - 2026-10-31

Changed

  • The Ecto CIBA and device-code stores share their throttled poll update and key lookups. Behaviour is unchanged.

Documentation

  • The 4.3.0 notes and "Upgrading to 4.3" state that the registration default only admits grants that are also in :grant_types_supported, and the 2.x upgrade notes on the registration grant catalog point to the 4.3 default.

[4.3.0] - 2026-10-31

Security

  • Refuse dynamic registration of redirect_uris and post_logout_redirect_uris whose query component carries a reserved OAuth or OpenID response parameter name (code, state, iss, error, error_description, session_state, response), returning invalid_redirect_uri. Appending authorization or logout response parameters onto a registered URI that already contains one of those names produces duplicate query parameters on redirect (Keycloak CVE-2026-9689 / CVE-2026-18209, django-oauth-toolkit 3.4.1, Doorkeeper #1851).
  • Breaking: dynamic registration (RFC 7591 §2) now admits only the grants in which a resource owner approves the client: authorization_code, refresh_token, and the RFC 8628 device grant, each only if it is also in :grant_types_supported, so a server without device authorization does not start admitting the device grant. Until now the endpoint accepted every grant the server supports, so an anonymous registration on an open endpoint could claim client_credentials, JWT-bearer, token exchange, or CIBA and mint tokens with no user in the loop. The new :registration_grant_types option lists the registrable grants explicitly (a subset of :grant_types_supported, validated at boot); a host whose registrants need client_credentials lists it there, behind its own admission control. Surfaced by mining the class behind Boruta CVE-2026-65635.
  • Breaking: private_key_jwt client assertions at the token and backchannel authentication endpoints must be audienced to the issuer identifier alone, as PAR, introspection, device authorization, and revocation already required. The token endpoint URL (and, at the backchannel endpoint, the backchannel endpoint URL) is no longer accepted by default: it is the value the 2025 audience-injection attack (CVE-2025-27370, CVE-2025-27371) relies on, where a malicious authorization server republishes this server's endpoint as its own and replays the assertion a shared-key client signs for it. A deployment whose clients, or a FAPI-CIBA test plan, still send an endpoint URL lists it in :client_assertion_audiences; accepted non-issuer audiences continue to emit [:attesto_phoenix, :client_authentication, :legacy_assertion_audience].
  • Breaking: without :introspection_authorize, token introspection releases an active response only to the client the token was issued to or a client named in the token's aud; any other authenticated caller receives {"active": false} (RFC 7662 §2.2). Until now every authenticated client could read any token's subject, scope, and audience, which made introspection a token-validation oracle for anyone who could obtain client credentials, including through open dynamic registration. A protected resource that introspects tokens audienced to a resource identifier other than its client_id configures :introspection_authorize to map callers to the resources they serve. Same class as the Keycloak introspection fixes of 2026.

Changed

[4.2.2] - 2026-10-27

Security

  • Decrypt direct_post.jwt presentation responses through Attesto.JWE, which admits only a public P-256 ephemeral key (epk) before JOSE parses the protected header. With JOSE 1.11.12 and earlier, an epk of another key type made decryption loop without end (CVE-2026-65628), and an RSA private epk without CRT members cost about a second of CPU per request (CVE-2026-65631). Any client holding a live presentation session id could send either. The endpoint is mounted only with presentation: true. Protected headers on this endpoint are now limited to 16 KiB.

Changed

  • Require Attesto >= 2.7.0 and < 3.0.0, which requires JOSE 1.11.13.

[4.2.1] - 2026-10-18

Changed

  • Require Attesto >= 2.6.1 and < 3.0.0, so the token endpoint's pre-authentication JSON nesting and size bounds ship with every 4.2 deployment instead of being a recommendation.
  • Give delivery_id a database default in the generated --upgrade 4.2 migration so a 4.1 writer that inserts a logout session during a rolling upgrade still succeeds; 4.2 writers always supply their own identifier. The README's "Upgrading to 4.2" section now states the rollout order and the one-line ALTER for databases migrated with the 4.2.0 generator.

[4.2.0] - 2026-10-18

Breaking

  • Require Attesto >= 2.6.0 and < 3.0.0. This pairs the Phoenix code-store compatibility fix and endpoint derivation with the corresponding core release.
  • Preserve a path carried by :issuer when deriving authorization-server endpoint and JWKS URLs. For example, https://id.example/tenant now produces https://id.example/tenant/oauth/token, matching Attesto core's endpoint derivation.
  • Require a positive :sweep_interval_ms when logout uses the bundled Ecto session store. The supervised sweeper now drives durable retry as well as expired-row cleanup, so it must be running before logout delivery can be reliable.

Security

  • Treat Client ID Metadata Document clients as self-asserted public clients even when they prove control of a document key with private_key_jwt. They can no longer enter confidential-only grants, introspection, or CIBA, and their declared grant_types are enforced.

  • Replace attacker-keyed Finch pools for CIMD, CIBA ping, and back-channel logout with bounded one-shot Mint connections. These requests now have a total deadline while retaining DNS pinning, TLS hostname verification, body bounds, and redirect refusal.

  • Reject unsafe registered redirect URI schemes and restrict JARM form_post.jwt actions to absolute HTTP(S) URLs under a restrictive CSP.

  • Read forwarded client IP, scheme, host, and port chains from the trusted-proxy end, and derive authorization-server DPoP endpoint URLs for token, PAR, and device authorization from configured endpoint metadata rather than an untrusted request Host.

  • Honor authorization-code replay containment during token exchange and introspection. A replay that overlaps first-request finalization now leaves a durable marker that revokes the newly issued refresh family and access token.

  • Redact session_management[:browser_state_secret] from Config inspection, reject NUL bytes before PAR JSONB persistence, and reject empty Basic passwords before a host client lookup.

  • Authenticate a token-endpoint client before reading an authorization-code record. Requests without client authentication now return invalid_client without revealing whether the code requires holder-of-key proof.

  • Bound the wallet attestation, OID4VP response code, and credential proof JWTs that are read before authentication to the limits Attesto core applies when it verifies them. Attesto 2.6.1 bounds JSON nesting on the same paths and belongs in the same deployment.

Fixed

  • Preserve subject-token expiry and client delegation lineage (act) during token exchange.
  • Use one redirect-URI registration policy for dynamic and host-provided clients. Native clients may use the common authority form of a reverse-DNS private scheme, while unsafe or non-native private schemes are rejected and reported through a warning instead of disappearing silently.
  • Pass CIMD metadata rather than the internal wrapper to device and CIBA host callbacks, and apply the CIMD same-origin redirect gate during PAR.
  • Reject invalid CIMD fetcher options immediately. Invalid :allow_loopback, :timeout, :max_document_bytes, and resolver values are configuration errors rather than retryable transport failures.
  • Make Ecto replay detection use ON CONFLICT DO NOTHING, so a detected replay does not abort a surrounding host transaction.
  • Build verification_uri_complete correctly when the configured device verification URI already has a query string.
  • Dispatch back-channel logout through supervised work and deliver a session's RP notifications concurrently. Each default delivery has a fixed deadline; the supervisor does not reject new logout jobs. Ecto logout-session rows now use durable delivery identifiers and expiring leases: successful handoffs are acknowledged, failed work is deferred with bounded exponential backoff, and a crashed worker's work is reclaimable after lease expiry. The initial and maximum delays are configurable with logout: [retry_initial_delay_seconds: ..., retry_max_delay_seconds: ...] and default to 30 and 3,600 seconds. The bundled sweeper claims due and expired leases in bounded batches and retries them automatically. It also verifies the lease columns at startup, while the end-session endpoint returns a visible server error if leasing cannot run. Existing installations must apply the generated --upgrade 4.2 migration before starting this release.
  • Parse browser Accept preferences through the shared quality-aware parser, so text/html;q=0 receives JSON rather than an HTML authorization or logout response.

Changed

  • Consolidate protected-resource authentication, client-authentication request wiring, replay claims, Ecto mutation setup, device/CIBA state transitions, metadata-controller setup, scope parsing, endpoint derivation, controller TLS error mapping, local sweeper liveness checks, and migration-task argument handling behind shared internal boundaries.
  • Validate generated migrations against the same schema contract used by the Ecto stores, including durable logout leases and upgrade backfills.
  • Cache the derived core configuration for one request and skip repeated validation when nested calls use the same Phoenix configuration.
  • Deprecate Callback.to_fun1/1, Config.schema_prefix/0,1, and Schema.DeviceCode.to_pending_view/1 for removal in 5.0. Deprecate the VerifierEncryption compatibility module now that verifier response encryption uses per-session ephemeral keys. Retain and deprecate the hidden Store.Sweeper.Signal.unsupervised/1 compatibility wrapper through 4.x.

[4.1.0] - 2026-10-17

Security

  • Reject every non-empty query string on the Device Authorization and CIBA backchannel-authentication POST endpoints, matching the existing token, PAR, introspection, and revocation endpoint guard.
  • Delegate Client ID Metadata outbound-address classification to Attesto's shared IANA-derived policy, including IPv4-embedded IPv6 and transition representations.

Fixed

  • Derive a Client ID Metadata Document client's identifier directly from its verified client record instead of invoking the host client-identifier callback again.
  • Honor shared-cache freshness directives (s-maxage, max-age, Expires, Age, and Date) when caching JWT-bearer assertion JWKS responses.

Changed

  • Require Attesto >= 2.5.0 and < 3.0.0 for the shared outbound-address policy used by Client ID Metadata retrieval.

[4.0.2] - 2026-10-15

Security

  • Allow registered public clients to revoke their own tokens using client_id, while retaining exact client and issuer ownership checks. Confidential, unknown, revoked, and method-switched clients still fail authentication, and cross-client revocation remains an indistinguishable successful no-op.

Fixed

  • Apply the token endpoint's registered public-client authentication rules at PAR, as required by RFC 9126. Public clients registered for none may push a PKCE-bound authorization request using client_id; confidential clients must continue using their registered authentication method.
  • Advertise revocation_endpoint_auth_methods_supported in OAuth and OpenID discovery metadata. Advertise revocation_endpoint_auth_signing_alg_values_supported when private_key_jwt is available.
  • Apply RFC 6749 error semantics at revocation: failed Authorization-header authentication returns 401 with its matching challenge, while body-only or missing credentials return 400 without an unrelated Basic challenge.

[4.0.1] - 2026-10-15

Fixed

  • Make the migration generator's --help option print its complete usage, including every supported upgrade milestone, and make invalid-argument errors enumerate all accepted options.
  • Handle --help before configuration checks, database access, certificate setup, or filesystem writes in the custom migration, refresh-issuer backfill, and development HTTPS tasks. The development HTTPS task now also rejects unknown options and positional arguments instead of ignoring them.

[4.0.0] - 2026-10-15

Breaking

  • Change the successful :build_deferred_credential callback result to {:ok, %{credential_configuration_id: id, holder_jwk: public_jwk, credential: credential_result}}. Results containing only credential claims are rejected because the deferred request has no new proof from which to recover the holder binding. Persist the configuration ID and verified public holder JWK with the transaction when the original request is deferred. See the 4.0 upgrade guide.
  • Require Attesto >= 2.4.0 and < 3.0.0. Phoenix now depends on the core authorization-code replay deadline, CIBA resource, and effective signed-JAR authorization_details APIs. The callback contract change makes this a major release under Semantic Versioning; the core additions remain a minor 2.4 release. Attesto 2.4.0 must be published first; only then can this repository replace its 2.2.2 lock entry and build the Phoenix Hex release.
  • Change consent-grant hashing to a type-tagged, length-framed encoding and bind the grant to resource, claims, and dpop_jkt in addition to the existing request fields. In-flight grants minted by 3.x cannot be consumed after the upgrade. binding_from_params/2 now raises on malformed input; consent controllers that pass untrusted raw parameters should use safe_binding_from_params/2 and handle {:error, :invalid_binding}.
  • Require every attesto_routes/1 route-mount option (registration, device, credential_issuance, federation, status_list, presentation, ciba, logout, session_management, userinfo, openid_configuration, and protected_resource_root) to expand at compile time to true or false.
  • Narrow Config's default :audience from the 3.x-advertised string-or-list contract to one absolute HTTPS resource identifier. Configure additional token targets with RFC 8707 resource parameters and :resource_indicators.
  • Require an integer :valid_until in every mso_mdoc result returned by :build_credential or :build_deferred_credential. The former default produced a credential that was already expired.

Security

  • Issue completed deferred SD-JWT VC, JWT VC, and mdoc credentials through the same holder-binding, entitlement, validity, and signing path as immediate issuance. The callback must resolve each transaction within the authenticated subject.
  • Retain consumed authorization-code records while the issued refresh family has an unexpired member, then delete the marker after that family ends. The correlated cleanup also gives legacy successful rows with a NULL family deadline a finite lifetime.
  • Reject every non-empty query string on POST token, introspection, revocation, and PAR endpoints, and fail closed when required host callbacks or stores are absent. Move non-protocol tracing or routing parameters off these endpoint URLs before upgrading.
  • Verify an OID4VP vp_token before signing its browser response-code JWT, so invalid public submissions do not consume signing work.
  • Enforce CIBA resource audiences from request through approval and token exchange, and preserve OID4VCI credential entitlements supplied inside a signed Request Object.
  • Harden client classification, Client ID Metadata fetching, outbound request bounds, refresh-family issuer and instance-key binding, and public-client authentication decisions.

Changed

  • Generate and document the complete ordered database upgrade path: 3.0, 3.1, 3.4, 3.6, and 3.7. Existing installations apply only milestones they have not already applied; a 2.x database needs all five while writers are stopped.
  • Add the 3.7 authorization-code replay_retain_until migration. Legacy successful rows linked to a refresh family retain NULL when the original deadline is unavailable; runtime cleanup uses live refresh descendants.
  • Pin the test-only Bandit dependency to the exact upstream fix for CVE-2026-105659. This does not enter published package requirements; replace the git pin with the first patched Hex release once one is available.

Fixed

  • Preserve refresh-token claims and credential configuration entitlements across rotation, and use stable family metadata for retry and revocation.
  • Normalize malformed controller input, callback failures, content negotiation, and nil store results to protocol errors rather than exceptions or successful empty responses.

[3.5.1] - 2026-10-04

Fixed

  • Accept clean JSON protocol requests under oauth_body_guard: :required and avoid missing-analysis telemetry after the configured reader has checked a JSON body. Duplicate JSON members remain rejected.
  • Support Ecto-backed refresh-store wrappers through an explicit refresh_store_backend declaration for rolling issuer migration and the administrative backfill task. Token operations continue through the wrapper; Ecto retry-secret and cleanup requirements still apply.
  • Generate 3.4 migration identifier quoting with Enum.map_join/3, so the generated migration passes strict Credo without manual editing.

Documentation

  • Document refresh issuer backfill from a release console, wrapper policy coverage during retry recovery, exact matching of non-loopback native callbacks, and encoded request bodies in protocol tests. See the 3.5 upgrade guide.

[3.5.0] - 2026-10-04

Added

  • Add an explicit single-issuer migration policy for legacy refresh families and a dry-run administrative backfill task. Bind family rows and authenticated retry contexts atomically without replacing existing issuers, extending expiry, or inferring Client Instance Keys. Strict rejection remains the default.
  • Diagnose missing raw-body duplicate analysis through bounded telemetry; oauth_body_guard: :required also rejects protocol form/JSON requests without the configured reader.
  • Add optional boot validation of the trusted registered-method callback and authentication-method mismatch telemetry. A temporary observation policy can permit only Basic/POST transport differences for secret-registered clients; key, certificate, attestation, and public-client differences remain rejected.
  • Add registration_default_application_type for hosts explicitly selecting a native registration profile. The default remains "web"; explicit client metadata is never overridden. See the 3.5 upgrade guide.

Fixed

  • Respect the configured native loopback-disable and localhost policies during registration, and reject loopback ports outside the valid range.
  • Allow rollback of an unused 3.4 migration under a table lock. Any persisted deadline or Client Instance Key prevents dropping those columns, including on expired or revoked rows. Retain the widened CIBA text column during rollback.
  • Resolve generated migration prefixes without a literal nil || expression.

Changed

  • Support IDNA 6.1.x alongside 7.x while rejecting empty DNS labels and label loss during mapping, with the same hostname policy and pinned-fetch tests.

[3.4.1] - 2026-10-04

Security

  • Bind every refresh family to the configured authorization-server issuer and enforce that binding before rotation, retry, introspection, or revocation. This prevents cross-issuer substitution when tenants share a refresh store. Pre-3.4.1 families lack the binding and require reauthorization.

  • Add an optional live refresh-principal callback with the persisted issuer, subject, session, authorization context, and family identity. A denial revokes the family before returning a generic invalid_grant.

  • Reject ambiguous duplicate query and URL-encoded form parameters, plus duplicate JSON object members at every nesting level, before OAuth dispatch. Preserve repeated RFC 8707 resource values and document the endpoint body reader needed to inspect the original encoded body.

  • Harden dynamic client registration: require a JSON object and enabled runtime gate; bound metadata collections and strings; validate redirect, logout, RFC 8705 identity, and public JWK metadata; apply configured private-key JWT algorithm policy; reject unsupported client_secret_jwt; and require unambiguous credential and Content-Type headers.

  • Apply the RFC 7591 authorization_code default when grant_types is omitted, and reject explicit JSON null for grant_types, redirect_uris, or scope instead of treating a present malformed member as absent.

  • Require an explicit consent callback before a public client can complete an authorization request, preventing unauthenticated first-party treatment.

  • Bound encrypted presentation JWE input and segments, reject non-canonical Base64URL and duplicate protected-header members, and enforce direct ECDH, IV, and authentication-tag constraints before decryption.

  • Keep CIMD/JWKS cache misses and outbound work behind request rate and concurrency controls, recheck the cache after admission, honor private and s-maxage cache directives, and avoid unnecessary remote JWKS work for Basic or form-post client authentication.

  • Run the configured dummy :verify_client_secret path for registered-method mismatches, compare Ecto cached refresh-successor token hashes in constant time, and isolate replay namespaces across private-key JWT and identity-assertion grants.

  • Enforce each client's registered authentication method before verifying its credentials across token, PAR, introspection, revocation, device authorization, and CIBA endpoints. Basic and POST must match exactly. Hosts with confidential clients must provide :client_auth_method or ClientStore.client_auth_method/1 using trusted registration data; absent, unknown, or malformed method data fails closed. See the 3.4.1 upgrade guide.

  • Issue client secrets only for secret-based authentication methods, removing unintended secrets from private-key JWT, mTLS, and attestation registrations. Existing secrets cannot authenticate a client registered for another method.

  • Allow registered private-key JWT, mTLS, and attestation clients to revoke tokens with their own credentials, under the configured method allowlist, rather than requiring an unrelated client secret. Preserve wallet Challenge and fresh-attestation errors for authenticated retries.

  • Bound CIMD and remote-JWKS outbound concurrency, request rates, concurrent resolution followers, failure backoff, and built-in ETS/Ecto cache capacity. Concurrent identical requests share one resolution. Built-in caches evict expired and earliest-expiring records and limit serialized record sizes.

  • Resolve enabled CIMD URL identifiers through their validated documents for secret authentication too, preventing fallback to a colliding registry secret.

  • Discard origin-supplied internal key-cache annotations before storing or returning client metadata. CIMD-enabled hosts must invalidate persisted metadata/key caches during upgrade; old freshness cannot be corrected without the original response headers.

  • Canonicalize hostname allowlists and denylists using lowercase IDNA ASCII names and remove one terminal DNS root dot before comparison and resolution. Preserve DNS/IP pinning and private-address screening.

  • Account for HTTP response age when caching client metadata, including Age and apparent age from Date, transport delay, and local residence time. Parse duplicate and malformed freshness headers conservatively and honor quoted directive values. Explicit freshness is never extended by the configured fallback TTL; no-cache and no-store remain uncached.

Fixed

  • Merge refreshed credential authorization into persisted internal claims so the original authorization-session identifier is retained.
  • Normalize client and registration errors so private values and oversized attacker-controlled metadata are not reflected to logs or responses.

Changed

  • Require Attesto 2.2.2 or later within the 2.x line for refresh issuer binding and the coordinated JOSE/parser hardening.
  • Validate an explicit token_endpoint_auth_methods_supported catalog at boot; reject client_secret_jwt and unknown custom extension values rather than advertising them. The documented unsupported combined attestation value continues to be omitted from the effective catalog.

[3.4.0] - 2026-10-03

Changed

  • 3.4 upgrade: Pre-3.4 attested refresh families now fail closed because their original Client Instance Key was not persisted. Revoke those families and authorize again. This release rejects binding an existing family on first use.
  • Require Attesto 2.2.0 or later within the 2.x line for the new refresh-family and credential metadata APIs.
  • Load the configured VC keystore before checking its optional certificate callback so the first issued credential includes the available x5c chain.
  • Include the VC keystore's certificate chain in mdoc issuer authentication and forward the callback's integer :issued_at into MSO validityInfo.signed. Reject malformed chains or timestamps before issuing a credential.
  • Require host-chosen mdoc :valid_until and valid timestamp ordering; reject missing or zero-length validity instead of issuing an unusable credential.
  • Keep the 3.x private-key JWT audience defaults compatible with existing clients and FAPI-CIBA plans. Hosts can select issuer-only rfc7523bis-11 policy after updating clients; accepted legacy audiences emit telemetry.
  • Resolve CIMD jwks_uri through the pinned, bounded metadata fetcher and reject private or symmetric keys in both inline and fetched public JWKS documents.
  • Support client-attestation draft 11 Challenge errors and fresh-attestation errors with bounded JWT time-claim validation, and retain its three optional client capability metadata fields during registration.
  • Require the authentication declared by a CIMD private-key JWT client.
  • Preserve validated credential authorizations through refresh, distinguish scope and explicit RAR permissions, and reject credential requests that exceed the original grant.
  • Bind attested clients' refresh families to their verified Client Instance Key independently of DPoP. Revoke and reauthorize pre-upgrade attested families, which lack the persisted key binding and now fail closed.
  • Allow a credential callback to supply integer :issued_at for SD-JWT VC timestamp policy; reject invalid supplied values without issuing a credential.
  • Add optional absolute refresh-token family deadlines and experimental refresh-token expiration metadata. Existing Ecto installations must generate mix attesto_phoenix.gen.migration --upgrade 3.4 --repo MyApp.Repo and run mix ecto.migrate before deploying this runtime, even when the maximum lifetime option is disabled. The migration adds nullable family_expires_at and attestation_jkt columns; upgrade every refresh-token writer before issuing families with fixed deadlines or Client Instance Key bindings.
  • Document RFC 10017 browser/BFF and RFC 10027 cross-device host policies.
  • Widen older CIBA notification-token columns to TEXT in the 3.4 migration so permitted 1,024-character tokens do not fail database insertion.
  • Exclude vulnerable Igniter releases and require patched Mint when the optional HTTP stack is selected.

[3.3.3] - 2026-09-30

Fixed

  • Refresh the development/test lock to Mint 1.11.0, which addresses EEF-CVE-2026-91043, EEF-CVE-2026-92103 and EEF-CVE-2026-94194.
  • Refresh-token rotation now gives each successor the configured :refresh_token_ttl. Rotation did not pass the lifetime to the Attesto core, so every rotated token received the core's 14-day default and only the first token of a family honoured the setting. Under a shorter configured lifetime, rotated tokens outlived it. Under a longer one, a successor expired before its own parent, so AttestoPhoenix.Store.Sweeper could delete later generations of a family while an earlier, consumed generation remained. Hosts using the default lifetime of 14 days are unaffected.

Upgrade notes

  • The rotation fix applies to successors minted after the upgrade. A refresh token rotated before it keeps its stored 14-day expiry until it is rotated again or expires. A host configured with a shorter lifetime that needs it enforced at once must revoke those families. A host configured with a longer lifetime can still observe a family whose later generations were swept ahead of an earlier one, until that earlier row expires: at most one configured lifetime after the upgrade.
  • Rotated tokens now follow the configured lifetime in both directions. A host configured above 14 days sees a rotated token's lifetime grow from 14 days to the configured value. A host configured below 14 days sees a rotated token's reuse-detection window shrink with it: once the sweeper deletes the consumed row, replaying that token returns invalid_grant without revoking the family or emitting the reuse event, as was already the case for the first token of a family.

Contributors

  • Thanks to @oliver-kriska for the configured refresh-token lifetime fix (#37) and the Mint security lock refresh (#38).

[3.3.2] - 2026-09-24

Fixed

  • Complete the synchronous :auth_denied callback before sending any protected-resource authentication 401, including core Bearer, DPoP, mTLS, nonce and step-up failures and wrapper TLS, revocation and principal failures. The audit also precedes custom error transports and is emitted exactly once. Shared controller authentication uses the same guarantee. RequireScopes audits unauthenticated 401s when request-private or explicit configuration supplies an event sink; ordinary scope refusals remain 403. Hosts must commit their audit write before the callback returns to guarantee durable recording before the client sees the response. An explicit recording error remains operator-visible as a warning and the request is still refused; a callback exception propagates before the response is sent. Uses the existing Attesto 2.0 transport contract; no core upgrade is required.
  • Refresh the development/test lock to Mint 1.10.1, which addresses EEF-CVE-2026-82672, and its compatible HPAX dependency.

[3.3.1] - 2026-09-12

Added

  • Warn during router compilation when both bundled OIDC routes are disabled but the host application's AttestoPhoenix.Config leaves openid_provider implicit. Explicit false identifies an OAuth-only server; explicit true records that replacement OIDC routes are intentional.

Fixed

  • Advertise the mounted revocation_endpoint in RFC 8414 authorization-server metadata as well as OpenID Provider Metadata, using the shared metadata builder so the endpoint cannot drift between the two documents.
  • Clarify that the bundled root and optional path-inserted RFC 9728 documents describe one resource and share one protected_resource_scopes_supported catalog; multi-resource installations need per-resource metadata catalogs.

[3.3.0] - 2026-09-11

Added

  • Add the explicit openid_provider runtime capability flag. It defaults to true for compatibility; OAuth-only hosts set it to false, causing Provider Metadata and the bundled UserInfo endpoint to answer 404. When enabled, config adds openid once to the shared authorization-server scope catalog used by discovery, dynamic registration, registration defaults, and the built-in token scope policy. Explicit host authorization callbacks continue to take precedence, so existing client permissions are not expanded. OAuth-only hosts retain RFC 8414 discovery and may omit the OIDC routes with openid_configuration: false, userinfo: false.
  • Add protected_resource_scopes_supported for an independent RFC 9728 scope catalog. When omitted it retains the legacy raw scopes_supported catalog; centrally added OIDC scopes are never copied into protected-resource metadata.

[3.2.1] - 2026-09-03

Fixed

  • Format every migration that mix attesto_phoenix.gen.migration writes with the host project's formatter configuration, plugins included, repeating until the file is stable. The raw templates did not satisfy mix format --check-formatted: a heredoc argument followed by [], log: false) is rewrapped by the stock formatter, so a host with a format check in CI failed on the generated file. If a host formatter plugin raises, the default Elixir formatter is applied instead and a warning names the file.

[3.2.0] - 2026-09-03

Added

  • Add --upgrade 3.0 and --upgrade 3.1 modes to mix attesto_phoenix.gen.migration. Existing 2.14.x databases run both, in order: the first installs the refresh-family generation invariant and durable revocation tombstones; the second promotes the historical authorization-code unique index to the current primary key. Both modes honor explicit, migrator, and repository-default schema prefixes, validate existing objects before adopting them, use a short transaction-local lock timeout, and fail the migration transaction on an unsafe or ambiguous database layout. Their rollbacks preserve durable revocation and replica-identity guarantees. The tombstone-table preflight also rejects row-level security, policies, user triggers, and rewrite rules that could alter or suppress the backfill, and a post-backfill invariant confirms that every previously revoked family has a durable tombstone before the transaction can commit. Migration filenames are allocated under a directory-wide exclusive lock, remain strictly ordered after existing or future-dated 14-digit versions, and fail closed on lock residue or a conflicting generated upgrade.
  • Support -r as an alias for --repo in the migration generator, and resolve repo priv paths correctly for umbrella projects and absolute :priv paths.
  • Add AttestoPhoenix.Store.Sweeper.running?/0,1 and verify_running!/0,1 to check whether a genuine sweeper or an acknowledged cleanup worker is active for a repository and schema prefix. These functions read process liveness from a registry owned by the package root supervisor, so their answers stay correct while the diagnostics supervisor restarts or remains stopped.
  • Add AttestoPhoenix.Store.Sweeper.register_cleanup_worker/1,2 to allow applications with an equivalent cleanup process to register its PID and suppress missing-sweeper warnings while it remains alive.
  • Emit an asynchronous warning and [:attesto_phoenix, :store, :sweeper_unsupervised] telemetry event when an application-facing mutation in a bundled Ecto store runs without its cleanup worker, including refresh-store deployments with zero retry grace. Repeated signals are limited to once per repository/schema pair per hour and retained diagnostic state is capped at 1,024 pairs. Diagnostic failure never changes store results or blocks on Logger or telemetry handlers. A registration for a still-live local custom worker survives an :attesto_phoenix application restart in the same VM; register again after the worker itself restarts or on a new node boot.
  • Start a small package-owned supervision tree for bounded sweeper monitoring and asynchronous diagnostic delivery.
  • Update the installer completion notice to distinguish fresh schema generation from the supported --upgrade 3.0 and --upgrade 3.1 migration paths for existing databases.
  • Make Sweeper.sweep_now/0 resolve the packaged worker registered for the current repository/schema pair. It now raises an actionable RuntimeError when that worker is absent instead of surfacing a generic :noproc exit; a registered equivalent cleanup worker is intentionally not invoked as the packaged sweeper.

Changed

  • Make the Igniter installer's schema and OAuth-route selection fail closed on retired, dynamic, conditional, internally conflicting, or otherwise ambiguous host configuration. An explicit --schema-prefix may select a matching environment-specific literal without rewriting the host's configuration, but cannot override a conflicting value in one source. An explicit --oauth-path-prefix must match the single configured literal so the compiled route cannot diverge from advertised endpoints.
  • Replace the hand-transcribed authorization-code primary-key migration in the 3.1.0 upgrade notes with the generated --upgrade 3.1 migration. Its rollback clears and restores REPLICA IDENTITY USING INDEX around the constraint drop, a step a hand copy of that template had already omitted in the field. Generated migrations resolve their schema from --schema-prefix, then Ecto.Migration.prefix/0, then the repository's :migration_default_prefix; host-authored raw SQL can call prefix/0 the same way instead of a hardcoded module attribute.
  • Raise the optional Igniter dependency floor from 0.5 to 0.6, the oldest line that compiles on this package's supported Elixir/OTP floor.
  • Clarify that the controller contract is the two request-private Attesto configuration values; AttestoPhoenix.Plug.PutConfig is the reference implementation, not the only valid way to populate them.
  • Expand the stopped-cutover guide and installer notice around the supported generated upgrade migrations and the concrete hazards of mixed 2.x/3.x token writers.

[3.1.0] - 2026-09-02

Added

  • :authorization_code_completion - an optional synchronous wrapper around the tail of an authorization-code redemption (principal construction, host ID-token claim construction, access- and ID-token minting, optional logout-session recording, access-token jti recording, optional generation-0 refresh issuance, and code finalization). A host may run it inside its own Repo.transaction/1 to serialize token issuance with a subject-authorization re-check. The continuation is bound to the callback's process and permits exactly one invocation; a second, cross-process, or escaped call is refused before anything is minted or persisted. The callback's return is verified by provenance rather than its outward tuple form, so a callback that never invokes the continuation cannot substitute a fabricated {:ok, response, events} for a real token set. The {:ok, _} wrapper that Repo.transaction/1 places around a committed return is unwrapped instead of failing a request whose code is already finalized. Rollback covers only stores using the same Ecto Repo and enclosing transaction. Scope and resource resolution precede this initial authorization-code completion hook; refresh rotation and every other grant type bypass it. It is not a per-request resource-server or MCP reauthorization mechanism. An exception, throw, or exit after successful continuation emits a static, secret-free error naming the possible finalized-code/retry-revocation hazard, then propagates with its original stacktrace. Reuse detection can revoke that response's access token and the refresh-token family descended from that redemption, forcing the client through a new authorization flow; it does not revoke unrelated authorization grants. A success wrapper around a failed continuation is also unwrapped but emits a static warning because earlier writes may have committed. A callback that catches a continuation termination before it returns may return an OAuth error, with a static warning about possible partial writes; a substituted success is refused.
  • :authorization_code_private_context - an optional trusted issuance callback for host-private authorization state. It receives exactly the authorized :client_id, :subject, and the freshly generated authorization-grant provenance :family_id (not the separately generated refresh-rotation family identifier), and its return value is supplied back as :private_context in the completion callback's context. The value must be a portable JSON object of at most 4 KiB encoded. It is stored as plaintext JSONB, not encrypted, so it is for non-secret identifiers and policy epochs rather than credentials or token/key material. It rides with the code inside the canonical grant claims under a reserved namespaced key, and is lifted off the grant before principal construction so it never reaches an access token, ID Token, refresh token, or token-exchange input. This feature adds no column migration; independent release migrations still apply. Configuring it without :authorization_code_completion is refused at boot, and a code that carries private context is refused with the generic invalid_request unable-to-issue-token response on a node whose completion callback is missing, so config skew cannot silently skip the host's policy. The reserved key belongs to the bundled authorization endpoint; custom authorization-code issuers and reconstruction paths must reject claims_key/0 in request-derived claims. A private-context callback exception propagates, and a PAR request_uri may already be claimed when it does. If a host transaction rolls back after the continuation succeeds, the callback must return an error rather than the captured success; the library cannot infer the transaction's outcome after the callback returns. Thanks to @oliver-kriska for the contribution in #25.

Changed

  • Key attesto_authorization_codes on code_hash as its PRIMARY KEY instead of carrying only a unique index on it. It was the one generated table without a primary key. Under its historical REPLICA IDENTITY DEFAULT setting it therefore has no usable identity index; if a logical-replication publication publishes its UPDATEs or DELETEs, those writes fail at the publisher until an identity is configured. AttestoPhoenix.Schema.Authorization now declares the key and maps a duplicate insert onto attesto_authorization_codes_pkey, the convention the other keyed tables already follow. Fresh migrations from mix attesto_phoenix.gen.migration create the keyed layout. Stored columns, single-use semantics, and the store API are unchanged. Thanks to @jtippett for the contribution in #26.

Fixed

  • Tighten the authorization-code catalog preflight: it now rejects NULLS NOT DISTINCT indexes and requires both the code_hash column and its index to use the database-default collation. The query remains executable on PostgreSQL versions before 15, where pg_index.indnullsnotdistinct does not exist.

Security

  • Token exchange now strips credential_configuration_ids from inherited claims, so exchanged tokens cannot inherit credential-issuance entitlement.
  • Mark claims redact: true on AttestoPhoenix.Schema.Authorization, hiding the authentication context and optional host-private state from ordinary struct and changeset inspection. Because Ecto.InvalidChangesetError renders raw changes and params independently of schema redaction, the bundled code store now replaces a failed insert changeset with a value-free one before raising that exception. Direct Ecto callers and custom stores remain responsible for equivalent exception handling.
  • Retain the code store's pre-existing suppression of application SQL logging and Ecto query telemetry on every operation. Narrow the two reuse-detection reads to only the columns they report, keeping claims out of decoded rows as defence in depth, and add disclosure-focused regression coverage. Suppression remains unconditional; custom stores and database-server logging remain the host's responsibility.

Upgrade notes

  • When upgrading an existing Ecto database, apply a forward migration that promotes the existing unique index on attesto_authorization_codes.code_hash to the table's primary key. The application and migration may be deployed in either order: new application code recognizes both the historical unique index and the new primary-key constraint. Once migrated, either application version runs against the keyed layout; a duplicate code_hash raises Ecto.ConstraintError on the previous release and Ecto.InvalidChangesetError on this one.

    That ordering flexibility does not extend to logical replication. The migration must finish before this table is added to a publication that publishes UPDATE or DELETE. If the historical default-identity table is already in such a publication, the corresponding authorization-code conditional-update or cleanup-delete path fails at the publisher until its replica identity is fixed (or that operation stops being published for the table). PostgreSQL logical replication does not copy DDL: apply the schema change to the subscriber first, then to the publisher. If REPLICA IDENTITY FULL was used as a temporary publisher-side bridge, keep it until both sides have the primary key. The generated migration preserves FULL; when FULL was a temporary publisher-side bridge, reset it to DEFAULT in a separate reviewed migration once the subscriber is ready.

    attesto_phoenix 3.2.0 generates this migration:

    mix attesto_phoenix.gen.migration --upgrade 3.1 --repo MyApp.Repo
    

    Upgrade the package to 3.2.0 or later before writing this migration. The generator is a Mix task, so the file can be produced and reviewed before the new application code is deployed. The generated migration validates the historical index against the catalog, promotes it under a 5-second transaction-local lock_timeout, and on rollback clears and restores REPLICA IDENTITY USING INDEX around the constraint drop, because dropping the primary key drops its index and PostgreSQL refuses that drop while the index is the table's active replica identity. A hand-written copy of this migration is easy to get wrong in exactly that down/0 step, so this changelog no longer carries one. The generated migration applies only to the historical generated layout and fails closed on a custom or renamed table/index. A surrogate-primary-key layout may need no change. The schema-prefix guide covers literal-prefixed 2.x tables.

    The generated file resolves its schema from an explicit --schema-prefix, then Ecto.Migration.prefix/0, then the repository's :migration_default_prefix, and uses that one value for both its Ecto DSL calls and the raw SQL it executes. A host-authored migration that interpolates raw SQL can call prefix/0 the same way instead of maintaining a separate hardcoded schema attribute.

    When those prerequisites hold, PostgreSQL reuses and renames the existing index, so the forward change is metadata-only: it does not rebuild the index or rewrite the table and is normally fast. ALTER TABLE nevertheless takes an ACCESS EXCLUSIVE lock. Under live traffic, the ALTER can wait behind existing transactions; because an ACCESS EXCLUSIVE request queues ahead of later conflicting work, blocking of new reads and writes can begin while it is still waiting. Once acquired, it blocks reads and writes until the migration transaction commits. PostgreSQL may emit a harmless notice that it is renaming the reused index to match the primary-key constraint. Run the migration in a controlled deployment window. Keep a short lock_timeout (the generated migration uses 5 seconds), below the application's query timeout, so contention aborts the attempt before waiting requests time out; then inspect blockers and retry during a quiet period, or drain traffic touching the table. Keep the migration transactional; SET LOCAL lock_timeout ends with its transaction and would not cover the following ALTER TABLE if @disable_ddl_transaction true were added. A FULL-to-DEFAULT reset is a second ACCESS EXCLUSIVE ALTER and needs its own controlled window.

    The down/0 path is materially slower: it drops the primary-key index and rebuilds the plain unique index while the transaction retains the table's ACCESS EXCLUSIVE lock. When REPLICA IDENTITY USING INDEX is active on the promoted primary-key index at rollback time, it is restored on the rebuilt unique index. Treat rollback as a potentially long, blocking index build rather than the metadata-only inverse of up/0.

    Skip the migration for a database whose tables were created by this release's generator: it already has the key, and PostgreSQL rejects adding another primary-key constraint.

[3.0.0] - 2026-08-31

Breaking

  • Replace the public 2.x host :table_prefix and package-level config :attesto_phoenix, :table_prefix settings, plus the --table-prefix migration-generator option, with :schema_prefix and --schema-prefix. In v2.14.2, the generator could prepend the value literally to table names in public, while most runtime stores queried canonical public tables and only EctoCIBAStore and Sweeper passed it as an Ecto schema prefix. The old value therefore did not identify one coherent runtime layout. Version 3.0 keeps canonical table names and selects one PostgreSQL schema through Ecto's prefix: option. Legacy keys and flags now fail closed with an upgrade message instead of being silently reinterpreted.
  • Require protocol controllers to receive the validated request configuration in conn.private[:attesto_phoenix_config]. The value must be an %AttestoPhoenix.Config{} struct; missing or malformed private values fail closed with ArgumentError and no longer fall back to global application configuration. Controllers that consult protocol-level configuration (such as RFC 8414 OAuth Authorization Server Metadata and OpenID Provider Configuration discovery endpoints) also require conn.private[:attesto_protocol_config]. That value must be an %Attesto.Config{}. AttestoPhoenix.Plug.PutConfig is the reference implementation and standard route-pipeline plug: it derives the protocol config from the host config and rejects a preinstalled divergent value. Custom plugs remain supported, but they own deriving and keeping those two private values consistent before controller dispatch. Thanks to @MuNeNiCK for reporting the request-scoping gap and independently proposing a fix in #24.
  • Register the bundled Ecto sweeper under a deterministic repository/schema name so multiple policy profiles can coexist. Sweeper.sweep_now/0 resolves that configured default; callers using an explicit custom registration name must continue to call sweep_now/1.
  • Require Attesto 2.0 and its atomic refresh-store rotation contract. Custom refresh stores must replace the former multi-step consume/insert/successor callbacks with one family-serialized rotate/4 transaction.
  • Update the bundled Ecto device-code store to Attesto 2.0's full-entry lookup and atomic, time-aware decision callbacks. Custom device-code stores must adopt the corresponding Attesto 2.0 behavior contract.
  • The default dynamic-registration grant catalog now includes the implemented OAuth token-exchange grant. Hosts that do not want to register clients for it must explicitly narrow :grant_types_supported.
  • Optional CIBA, device-authorization, JWT-bearer, and pre-authorized-code grants are added to the default catalog only when :grant_types_supported is unset. An explicit catalog is now exact, so 2.14.2 deployments that enabled one of these features must add its exact grant URN before upgrading.
  • Client-authentication method policy is exact in 3.0. In 2.14.2, an unset or empty :token_endpoint_auth_methods_supported value did not restrict endpoint authentication, so mTLS could work when its callbacks were wired. In 3.0, nil defaults to client_secret_basic, client_secret_post, private_key_jwt, and none; tls_client_auth and self_signed_tls_client_auth must be listed explicitly, with their required callbacks, when retained. Any non-nil list, including [], is exact; wallet attestation remains conditional on trusted Wallet Provider keys.

Security

  • Retain an expired authorization-code row while its linked access token is still live, so replay detection and access-token revocation remain enforceable. Unlinked rows, malformed rows, and rows whose linked token has expired are still reclaimed by the sweeper.
  • Suppress both Ecto Logger output and repository query telemetry for credential-bearing and privacy-sensitive values, including consent tokens, DPoP nonces, device user codes, PAR request URIs, CIBA notification tokens, refresh rows, and logout-session identifiers and targets.
  • Bind controller actions and the standalone authentication plug to the validated request configuration only for bounded work, selecting its Ecto repository and schema prefix together and restoring state on success, halt, or failure.
  • Enforce a lossless portable JSON boundary for persisted claim maps, including nested values, nulls, booleans, and I-JSON-safe integers (±9_007_199_254_740_991); incompatible pre-3.0 persisted maps fail closed when read.
  • Recognize only exact v1/v2 encrypted refresh-successor wrappers and redact malformed, unknown, or tampered state conservatively no later than the parent token expiry.
  • Enforce a DPoP nonce row's persisted expiry as well as the caller's freshness window, so a nonce issued with a shorter lifetime cannot be accepted after its stored deadline.
  • Honor the validated request's configured refresh store for RFC 7009 revocation, ahead of the compatibility-only conn.private override. Load a configured code-store module before probing its optional access-token revocation callback, fail closed when the module cannot load, and continue to require an exact boolean when that callback exists.
  • Fail configuration construction when the bundled Ecto refresh store uses a non-zero rotation retry grace without a usable :refresh_successor_secret. The Igniter installer now adds an idempotent runtime setting that requires a stable secret of at least 32 bytes in production and provides only an explicit development/test fallback.
  • Reject invalid refresh-rotation grace values, non-boolean top-level policy switches, and required DPoP nonce enforcement when DPoP is disabled or no capable nonce store is configured, instead of silently omitting requested security behavior.
  • Reject required OID4VCI key attestation when no usable trusted verification key is configured, instead of silently omitting the requirement from proof verification.
  • Require exact boolean results from security-policy callbacks and exact booleans for nested feature and request-object policy fields. Malformed public/native-client classification, sender-constraint policy, request-object requirements, loopback exceptions, and confirmation controls now fail loudly instead of being treated as enabled or disabled by truthiness.
  • Enforce documented callback and store result contracts across client and principal lookup, grant presence, scope policy, replay and nonce handling, PAR, device approval, CIBA, credential issuance, introspection, and dynamic audience resolution. Unexpected results fail loudly with fixed, value-free diagnostics; post-commit notification and audit-delivery failures emit fixed warnings. Ordinary protocol denials retain their existing wire responses.
  • Preserve the authenticated fixed retry deadline in Ecto successor records, reject a mismatched housekeeping deadline, and redact encrypted successor credentials after that deadline while retaining a deadline-only tombstone. The installer now supervises AttestoPhoenix.Store.Sweeper after the host repo so this cleanup actually runs.
  • Preserve bounded retry compatibility for v1 encrypted successors at a stopped 2.14.2-to-3.0 cutover by deriving their deadline from persisted consumed_at and the configured grace, capped before token expiry. A retry after that window remains reuse and revokes the family.
  • Require an atomic PAR take/1 implementation when require_pushed_authorization_requests: true; fetch-only stores remain valid for optional PAR. Refresh-family revocation now surfaces transaction rollback instead of returning false success, and prebuilt application config structs are fully revalidated before use.
  • Persist refresh-family revocation tombstones in attesto_refresh_family_revocations, separate from expirable token rows, so the sweeper cannot erase the decision and permit a later family resurrection.
  • Bind authorization-code replay markers to the refresh family actually issued by the core composition API, and retain the access-token JTI linkage by code hash until that family is finalized. Refresh issuance is refused for reuse-tracking code stores that expose only the legacy family callback, rather than recording a token under the wrong refresh family.
  • Keep asynchronous CIBA user-notification callbacks and ping delivery inside the validated request-local configuration, so concurrently mounted profiles retain their own policies and Ecto schema prefixes.
  • Disable Phoenix route-dispatch parameter logging on protocol and interactive routes. These requests can contain redeemable codes, assertions, proofs, signed request objects, and encrypted responses that Phoenix's default substring filters do not comprehensively cover. Endpoint method/path/status logging remains available; hosts must apply the same rule to custom request and header loggers.
  • Emit the documented :refresh_reuse_detected host event when core refresh reuse detection revokes a family, alongside the ordinary token-denial event. Refresh issuance and rotation events now include the resource-owner subject.
  • Enforce Attesto 2's exact canonical authorization-code, CIBA, device-code, refresh-token, and refresh-successor contexts at the bundled Ecto write boundaries. Missing, extra, or malformed members are rejected before column projection, and malformed persisted confirmation data remains invalid rather than being interpreted as an unbound credential.

Fixed

  • Preserve explicitly empty grant-type and client-authentication catalogs in discovery, endpoint enforcement, and dynamic registration instead of widening them to package defaults. Malformed catalogs and per-client grant lists are rejected rather than treated as unrestricted.
  • Require bundled Ecto code-store transitions and access-token linkage to update exactly one authorization record, and make logout-session persistence refusal visible instead of reporting silent success.
  • Clear the refresh-family marker when an Ecto authorization code is finalized without issuing a refresh token. A later replay is rejected and revokes only the code-linked access-token JTI, never a refresh family.
  • Route revocation events through the fully resolved event callback, including behavior-module :event_sink configuration, and warn without payload data when an event sink explicitly reports delivery failure.
  • Let the installer-added sweeper child return :ignore when an upgraded host has no sweep interval, while manual supervision and invalid configured intervals continue to fail at startup.
  • Treat replay of a legacy consumed authorization-code row with no access-token JTI as an idempotent no-op, so the generic invalid_grant path cannot become a 500 while still enforcing exact-one revocation for linked tokens.
  • Map Attesto refresh rotation's :temporarily_unavailable result to OAuth temporarily_unavailable with HTTP 503. The parent token remains valid for a retry; logs and the denial event carry only the fixed operational code, never the store's internal reason.
  • Run synchronous CIBA approve/deny transitions and ping endpoint resolution inside the passed request configuration, including for conn-free callers.
  • Round-trip authorization codes through the exact nine-key Attesto 2 grant context: the database-only PKCE method is no longer returned as a sibling member, and a legacy nonce column is promoted into :claims. Refresh-token persistence now preserves duplicate scope members instead of silently deduplicating them.

Upgrade notes

  • Every 2.x-to-3.0 deployment, including one using the default public schema, requires a stopped cutover for all token writers. Drain 2.x nodes and workers, apply the refresh-generation index and durable revocation-table migration, then start 3.0 and re-enable traffic. Mixed 2.x/3.0 writers are strictly unsupported because:
    1. 3.0 records a durable tombstone and removes the family's refresh rows. A later 2.x insert checks only family_revoked rows, sees none, and can add a live token to the revoked family.
    2. 2.x records revocation only on refresh rows. Once 3.0 cleanup removes every expired row in that family, it also removes the only revocation record because 2.x never wrote a tombstone.
    3. 3.0 writes v: 2 successor envelopes, which bind the child hash. A 2.x node can treat an honest retry of that rotation as reuse and revoke the family because it understands only v: 1 envelopes.
    4. Once the new (family_id, generation) unique index exists, a colliding 2.x insert can raise an unhandled Ecto.ConstraintError; 3.0 reports the conflict through the store contract.
  • A non-empty 2.x :table_prefix value does not identify one runtime layout. Before any 3.0 node starts, inventory public canonical, public literal-prefixed, and schema/canonical candidates for every table using counts, observed behavior, and backups. Stop if a logical table has split non-empty data; move only a verified source relation into one PostgreSQL schema. Never run mixed 2.x/3.0 nodes, workers, or migration commands during this stopped cutover; see guides/upgrade_3_0_schema_prefix.md. Remove every legacy :table_prefix setting, then configure :schema_prefix and use --schema-prefix for future fresh migrations.
  • When performing this upgrade with attesto_phoenix 3.2 or later, generate the required Ecto migration with:
    mix attesto_phoenix.gen.migration --upgrade 3.0
    
    A host whose stores use a schema passes it explicitly:
    mix attesto_phoenix.gen.migration --upgrade 3.0 --schema-prefix oauth
    
    This emits the exact DDL creating the unique index on attesto_refresh_tokens(family_id, generation) with a short transaction-local lock timeout (5s), creating the attesto_refresh_family_revocations durable tombstone table, and safely backfilling already-revoked families (family_revoked = true) into the tombstone table using CURRENT_TIMESTAMP AT TIME ZONE 'UTC' and ON CONFLICT (family_id) DO NOTHING. If creation reports duplicate (family_id, generation) rows, stop, reconcile and revoke the affected families, then retry; never blindly delete duplicate rows. Do not rerun the create-table migration. Keep every writer stopped during rollback; its guard aborts unless every corresponding legacy row exists and has family_revoked = true, including when a family has mixed true and false rows. Before starting 2.x, drain active 3.x refresh-retry deadlines or accept that honest retries may be invalidated.
  • Dynamic-registration clients inherit the 3.0 default grant catalog, which includes token exchange. Set an explicit grant_types_supported catalog before deployment when token exchange must remain unavailable. Explicit empty grant/auth-method catalogs remain empty rather than widening to defaults.
  • Existing installations using AttestoPhoenix.Store.EctoRefreshStore with positive refresh retry grace must configure one stable :refresh_successor_secret of at least 32 bytes across every node and deployment. Configuration now fails at startup if it is absent or too short.
  • At a stopped 2.14.2-to-3.0 cutover, an authorization-code refresh can preserve the configured :authorization_grant_id_claim using its bounded legacy lineage marker. Other grant types and families started while that feature was disabled remain excluded from the claim.
  • Manual Ecto installations must supervise AttestoPhoenix.Store.Sweeper with a positive :sweep_interval_ms; rerunning mix attesto_phoenix.install adds the child idempotently. The sweeper redacts expired refresh-successor ciphertext and prunes expired TTL rows; durable family revocation tombstones are intentionally never swept. A custom cleanup job must provide equivalent behavior.

[2.14.2] - 2026-08-28

Added

  • Add opt-in :authorization_grant_id_claim configuration for a stable, library-owned authorization-code family claim on initial and refreshed access tokens. The claim reuses the 128-bit refresh family_id, survives rotation and lost-response retry while jti changes, is omitted from other grants, and remains disabled by default without requiring a migration. An authorization code issued without a family_id is permanently ineligible for the claim: such a grant still starts an internal refresh family, but neither its initial nor any refreshed access token carries the claim. Thanks to @oliver-kriska for the contribution in #23.

Changed

  • Authorization-code family identifiers are now generated with Attesto.Secret.generate(16) — 128 bits, 22 unpadded Base64URL characters — matching the refresh-family identifiers generated by Attesto.RefreshToken. They were previously 32 bytes (43 characters). This applies to every deployment, including those that leave :authorization_grant_id_claim disabled. Existing stored values are unaffected; only newly issued identifiers change length.

[2.14.1] - 2026-08-27

Security

  • CIBA configurations that require signed authentication requests now fail when AttestoPhoenix.Config is constructed unless an explicit atomic :replay_check callback is configured. Replay identities derived from verified request-JWT jti values are recorded through that boundary until their exp; a repeated signed request is rejected as invalid_request. An optional signed request also fails closed without that callback. Plain requests in explicitly unsigned generic CIBA profiles remain compatible.
  • CIBA replay identities are now fixed-length digests scoped to the authenticated client, preventing oversized store keys and cross-client false replay collisions.
  • Configured replay callbacks are now validated during configuration construction for a callable two-argument function or MFA contract, rather than failing on the first protected request.
  • CIBA :require_signed_request now rejects non-boolean configuration values during configuration construction so string or null environment values cannot disable request signing.

Upgrade notes

  • Do not run 2.14.0 and 2.14.1 nodes together while accepting signed CIBA authentication requests. Drain the 2.14.0 nodes and wait until every signed request JWT accepted by them has expired—conservatively 61 minutes—before starting 2.14.1; the fixed replay identity introduced here is intentionally different from the raw key used by 2.14.0.

[2.14.0] - 2026-08-27

Added

Fixed

  • The Igniter installer now writes config :attesto_phoenix, otp_app: ..., repo: ..., generates the config-loading router pipeline, passes it to attesto_routes/1, and repairs older installer route output that omitted the pipeline. Generated authorization, metadata, JWKS, and store paths therefore resolve the same host application instead of failing on missing config keys.
  • The generated host config now includes the required access-token :audience and wires the scaffolded principal_kinds/0 provider. Re-running the installer repairs both missing keys and adds only the missing callback stub to older scaffolded principal stores without replacing host definitions.
  • Direct-TLS detection remains warning-free and functional on every supported Plug line, using adapter peer data when the newer SSL-data helper is absent.

Documentation

  • Document the required global OTP-app/repo pointer and config-loading pipeline, and add the explicit CIMD plus localhost loopback compatibility settings for native clients that publish URL metadata and bind an ephemeral callback port.

[2.13.0] - 2026-08-13

Added

  • RFC 8705 §2 token-endpoint authentication with both tls_client_auth and self_signed_tls_client_auth, shared by the server's client-authentication service. PKI clients match one registered DN/SAN identity; self-signed clients match an exact registered x5c leaf.
  • RFC 8705 metadata integration for both auth methods, tls_client_certificate_bound_access_tokens, and validated mtls_endpoint_aliases.
  • Trusted-terminator certificate transport: :forwarded_cert_der is invoked only for an immediate peer in :trusted_proxies, while :client_certificate_chain_validated? makes PKI validation an explicit host assertion.

Security

  • Forwarded client-certificate headers are no longer an implicit extension of the generic certificate callback. The supported forwarded path is guarded by the trusted-proxy allowlist and tested against direct header spoofing. The documented deployment contract requires the terminator to overwrite the header and the application listener to be isolated from untrusted peers.
  • The legacy :cert_der callback is now subject to the same trusted-proxy gate as :forwarded_cert_der. Existing deployments that used :cert_der to read a terminator header must configure :trusted_proxies and migrate to :forwarded_cert_der; otherwise certificate binding fails closed. Direct TLS certificates are read from adapter peer data and need no callback.
  • Trusted-proxy decisions use Plug.Conn.get_peer_data/1's socket address, never the middleware-rewriteable conn.remote_ip. A forged X-Forwarded-For therefore cannot authorize an XFCC-style certificate.
  • Untrusted requests also recover direct transport and authority facts when standard forwarded headers have already been applied by Plug.RewriteOn: adapter SSL data controls HTTPS, the raw Host header controls authority, and socket peer data controls client IP. Forged forwarded headers cannot satisfy the HTTPS gate or redirect DPoP htu verification.
  • Certificate-bearing public clients now remain subject to each endpoint's allow_public policy. PAR, introspection, and CIBA cannot be changed from authenticated-only to public-client access merely by presenting a certificate.
  • mTLS client-metadata lookup errors and malformed callback results now fail authentication closed. Only an absent callback or an explicit nil result means the client has no mTLS authentication registration and may enter the endpoint's public-client path.
  • JWS credential and signed-metadata issuance now passes keystore modules into core, enabling Attesto.Signer non-extractable custody without changing PEM deployments. COSE mdoc signing and verifier decryption continue to require direct private-key access and are outside the JWS signer contract.
  • Require attesto >= 1.15.0; the RFC 8705 identity matcher and signer dispatch are runtime dependencies, so the floor is load-bearing.

[2.12.0] - 2026-08-11

Hardening of the ID-JAG (urn:ietf:params:oauth:grant-type:jwt-bearer) exchange at the token endpoint. Pairs with attesto 1.13.0 and now requires it: the core release supplies the assertion-claim validation this enforcement builds on, including the authorization_details rejection, which has no equivalent on this side.

Security

  • Signed resource is an audience ceiling. The exchange previously ignored the assertion's resource claim, so a client could exchange into any other locally permitted audience. A request omitting resource now defaults to the signed set, and one supplying it may narrow that set but never widen it.
  • Signed cnf.jkt requires matching proof-of-possession. An assertion carrying cnf.jkt is proof-of-possession authority, not a bearer credential; the token request must demonstrate the same DPoP key. A missing, mTLS, or different-key binding is now invalid_grant (draft §6.1, RFC 9449).
  • Scope ceilings are rechecked after host policy. A :authorize_scope callback could previously re-add an unrequested scope or exceed the ID-JAG / token-exchange ceiling. The granted result is now re-validated against both the signed ceiling and the requested set.
  • Replay identities are fixed-size and issuer-scoped. The store key is now sha256(iss ‖ jti) rather than the raw jti, so unbounded IdP input never becomes a database key and two trusted IdPs choosing the same identifier do not collide (RFC 7519 scopes jti uniqueness to its issuer).
  • Require attesto >= 1.13.0, keeping the Phoenix HTTP surface on the complete current core hardening baseline.
  • Refresh the test-only Postgrex lock past its stream-comment SQL-injection advisory; the driver does not enter this package's runtime closure.
  • Correct AttestoPhoenix.Store.EctoCodeStore.take/1's return specification to include consumed-code metadata and update its documentation to describe the atomic consume operation accurately. Thanks to @h8 for the contribution in #22.

Added

  • AttestoPhoenix.AuthorizationServer.JwtBearer.prepare/3, resolve_subject/2, and commit_replay_claim/2: a staged variant of authorize/3 that defers the host subject callback and atomic replay claim so sender binding, resource, scope, and host policy can be evaluated first. A caller of prepare/3 MUST resolve its verified claims and commit the returned :replay_claim before minting. authorize/3 remains the one-call API.

Changed

  • A rejected ID-JAG exchange no longer consumes the assertion's jti: the replay claim is committed only once every check has passed, so a policy denial does not burn an otherwise valid assertion.
  • Host-callback ordering: the token endpoint now invokes :resolve_jwt_bearer_subject only after sender binding, resource, scope, and host policy succeed, preventing invalid requests from triggering JIT provisioning, audit writes, or upstream lookups. Because the replay seam is atomically check-and-record (there is no non-consuming reservation), a validly signed replay can still reach the callback before replay rejection; callbacks with side effects should remain idempotent. Token issuance remains replay-protected.
  • Upgrade note: the replay-store key format changed (see above). Entries written by an earlier release are not recognized after upgrade, so during a rolling deploy an assertion already seen by an old node could be accepted once by a new one. The window is bounded by the assertion's remaining lifetime (at most :assertion_max_lifetime_seconds, default 300s).

[2.11.0] - 2026-08-10

Pairs with the attesto 1.12.1 wallet-surface security-hardening release and now requires it (>= 1.12.1). Carries the HTTP-surface fixes from the same 6-front adversarial sweep of the EU-wallet code.

Security

  • OID4VP direct_post.jwt downgrade: the direct-post response endpoint now rejects a plaintext submission when the session mandated encryption (an ephemeral response-encryption key is attached), instead of gating only on the global response mode. Closes a silent per-session confidentiality downgrade of the vp_token to any post-TLS intermediary.
  • Credential-proof iss binding: the credential endpoint now binds the proof's iss to the access token's client_id unconditionally (RFC 9068). Previously the check keyed off a grant_type token claim that is never written, so a forged/absent iss was accepted on the authorization_code flow.
  • credential_response_encryption: a request that asks for response encryption is now rejected (invalid_encryption_parameters) rather than silently answered with a plaintext credential.

[2.10.0] - 2026-08-10

Pairs with the attesto 1.11.0 security-hardening release and now requires it (>= 1.11.0). Carries the HTTP-surface fixes from the same audit rounds.

Security

  • JWE decompression-bomb guard on the OID4VP response endpoint. The direct_post.jwt path (presentation_response_controller) rejects any JWE whose protected header carries a zip member before JOSE.JWE.block_decrypt, so a compressed response cannot inflate a tiny ciphertext into gigabytes on the unauthenticated endpoint.
  • Dynamic Client Registration scheme allowlist. redirect_uris in the ordinary (authority) form must be http/https, and post_logout_redirect_uris are validated as http/https absolute URIs without a fragment — closing a javascript:/data:/vbscript: scheme-injection that reached the auto-executing form_post / logout-continuation sinks as stored XSS.
  • Server-side request forgery guard on outbound deliverers. The back-channel-logout and CIBA-ping deliverers screen the target through the new AttestoPhoenix.SSRFGuard — reject any resolved special-use IP (RFC 6890) and pin the socket to the checked address (Mint :hostname keeps TLS SNI / certificate verification / Host on the real name), closing the DNS-rebinding window. The shared special-use-IP table gained the missing IANA IPv6 ranges (100::/64, 2001:2::/48, 3fff::/20, 5f00::/16), which also hardens the Client ID Metadata fetcher.
  • Deferred Credential ownership contract + c_nonce single-use. The credential endpoint now consumes the request's c_nonce once (after the whole proof batch verifies) via the store's consume/1, failing closed if the store cannot; a captured proof can no longer be replayed for another credential. The deferred-credential callback contract documents that it MUST bind the transaction_id to the token subject.

Changed

  • Requires attesto >= 1.11.0.
  • A dev/test escape hatch, config :attesto_phoenix, allow_loopback_delivery: true, lets the outbound deliverers target a loopback server (off by default; keep it off in production).

[2.9.0] - 2026-08-10

Pairs with the attesto 1.10.0 security-hardening release and now requires it (>= 1.10.0). The behavioral fixes live in attesto core; this release carries the matching HTTP-surface guidance.

Security

  • Deferred Credential endpoint — documented the ownership check. The endpoint authenticates the caller and passes the token's verified subject to :build_deferred_credential, but the callback owns binding the transaction_id to that subject. The moduledoc and the callback contract now state, in the strongest terms, that resolving a transaction_id without scoping to subject is an IDOR (any authenticated wallet could poll another's transaction_id and receive its credential) and that transaction_id must be minted with a CSPRNG.
  • Credential-offer creation guidance. The by-reference offer controller doc now points hosts at Attesto.CredentialOffer.store_by_reference/3 (which generates the unguessable id) instead of minting their own.

Changed

  • Requires attesto >= 1.10.0. AttestoPhoenix.Verifier.presentation_result/2 is now single-use (it consumes the session) — a response_code captured from the browser cannot be replayed to re-read the presented claims. Read the result once on the completion redirect.

[2.8.0] - 2026-08-05

Added

  • native_apps: [loopback_include_localhost: true], an opt-in that widens the RFC 8252 §7.3 loopback port allowance to the bare hostname localhost, selecting attesto's :exact_allow_loopback_port_including_localhost matching mode wherever :exact_allow_loopback_port would have been selected (for hosts marked native via :client_native?, and for CIMD clients whose document declares a loopback redirect URI).

    Real native clients register a portless http://localhost/callback in their client-id metadata document and bind an ephemeral port at runtime — Claude Code's published document is one — and no strict deployment could serve them: exact comparison fails on the port and the §7.3 exception is scoped to the IP literals. §8.3 recommends the literal over the name, but its reasons are all client-side (which interface the client binds, its firewall, its host-name resolution); a server refusing the request changes none of them.

    The opt-in threads through all three places that must agree about what counts as loopback: the redirect-URI match itself, the CIMD native signal (AttestoPhoenix.ClientIdMetadata.loopback_redirect_uris?/2 — a localhost-only document now declares loopback under the widened mode), and the authorization endpoint's same-origin exemption (a localhost redirect is exempt exactly as the IP literals are). loopback_redirect_uri?/1 and loopback_redirect_uris?/1 gained an optional matching-mode argument, defaulting to the strict mode — existing callers are unaffected.

    Off by default; no behavior change unless selected. The flag is subordinate to the loopback_redirect: false kill switch, localhost never cross-matches 127.0.0.1 or [::1], and lookalike hosts (localhost.evil.example, sub.localhost, evil-localhost) stay outside — the anchoring lives in Attesto.RedirectURI and is exercised end-to-end in the authorize-controller tests. Requires attesto 1.9.0 or later, the first release carrying the :exact_allow_loopback_port_including_localhost mode.

    Thanks to @jtippett for the contribution in #20.

[2.7.0] - 2026-08-03

Added

  • OpenID for Verifiable Credentials (OID4VC / EU wallet) HTTP surface, wiring the attesto 1.8.0 core to Phoenix behind feature flags. Set credential_issuance: true to mount the OID4VCI issuer endpoints (Credential, c_nonce, Credential Offer + credential_offer_uri, Deferred Credential, Credential Issuer Metadata incl. a signed variant); set presentation: true for the OID4VP verifier endpoints (request object by reference + direct_post / encrypted direct_post.jwt response), targeting the HAIP profile.
  • The authorization server advertises the OID4VC surface on its metadata: authorization_details_types_supported: ["openid_credential"] when a credential issuer is configured, and the client-attestation signing-alg values when attest_jwt_client_auth is enabled; the token/PAR endpoints accept attestation-based client authentication (OAuth-Client-Attestation[-PoP]). The verifier advertises a fresh per-request response-encryption key for direct_post.jwt and supports the x509_san_dns / x509_hash client_id schemes.

[2.6.0] - 2026-08-02

Security

  • The token endpoint records the namespaced DPoP replay identity attesto 1.7.0's Attesto.DPoP.verify_proof/2 now returns (replay_key, a sha256(jkt:jti) digest), rather than the raw jti, matching Attesto.Plug.Authenticate. A shared replay store therefore never holds two key formats, and two token-endpoint proofs that share a jti but are signed by different keys no longer collide. The raw jti still rides through to [:attesto, :dpop, :replay_detected] telemetry for correlation. Requires attesto >= 1.7.0.

Fixed

  • Registration scope validation no longer does a cross-product scan of the requested scopes against the catalogue.

Changed

  • The demo Livebook (notebooks/attesto_phoenix_demo.livemd) is pinned to attesto_phoenix ~> 2.6 (was a stale ~> 0.6) and its replay_check argument is named for the opaque replay identity it now receives.

[2.5.0] - 2026-08-01

Security

  • Claim a token-endpoint DPoP proof's jti only after the grant has been validated (RFC 9449 §11.1).

    AttestoPhoenix.AuthorizationServer.SenderConstraint.resolve/3 passed :replay_check into proof verification, so the jti was recorded before the authorization code, refresh token, device code, or subject token was looked at. :replay_check is a check-AND-record operation, and a public client (RFC 6749 §2.1) authenticates with a client_id and no credential — so at that point the caller may be anyone who knows a registered public client's identifier.

    Such a caller could pair a self-signed DPoP proof with a bogus authorization code and write one replay-store row per request, for the cost of a signature, without holding any grant. Against the bundled ETS cache that is unbounded growth; against a shared store it is unbounded writes.

    resolve/3 now returns the claim as a deferred pending_claim, and every grant path commits it with commit_replay_claim/2. Replay rejection is unchanged: the claim is still an atomic check-and-record made before a response is issued.

    Placement within each grant is deliberate, because both ends are wrong. The code and refresh paths commit after a NON-destructive check that the grant exists and before it is consumed — committing after redemption meant a replayed proof burned a real grant (the code spent, or the parent rotated and a successor persisted) and only then refused the request. The device and CIBA paths commit on a validated grant including authorization_pending and slow_down, which are refusals but prove the caller holds the grant; otherwise one captured proof could poll indefinitely without ever being recorded.

    Breaking for direct callers of AttestoPhoenix.AuthorizationServer.SenderConstraint.resolve/3: it now returns a four-element tuple. Hosts matching the documented {:ok, binding, token_type} must add the pending_claim element and commit it. Hosts using the endpoints are unaffected.

Security

  • Mark a resolved CIMD client with the AttestoPhoenix.ClientIdMetadata.Client struct instead of a {:cimd, metadata} tuple.

    The host's client value is opaque by contract — the library never inspects it, and a host may represent a client however it likes, including as a tuple. A tagged tuple therefore made {:cimd, _} a shape a host could return from :load_client by coincidence, and every CIMD-specific decision keyed on that shape alone: the client would take its redirect URIs from the tuple's map rather than the host's callback, receive the RFC 8252 §7.3 loopback port allowance, and — because client_public?/2 answers true for a CIMD client — authenticate with no secret at all.

    A struct cannot be produced by coincidence; a host that constructs one has named the module explicitly. This is an internal marker, not a value hosts were meant to build, so no host that used the documented callbacks is affected.

[2.4.0] - 2026-07-28

Security

  • Hold the CIMD same-origin check to URIs on which every URL parser agrees. AttestoPhoenix.ClientIdMetadata.same_origin_redirect_uri?/2 compared origins using Elixir's RFC 3986 parser, while the browser that receives the Location uses the WHATWG URL Standard. https://evil.example\@client.example/cb reads as host client.example under the first and evil.example under the second, so the check could approve a redirect URI the authorization response would not actually be delivered to.

    Requires attesto >= 1.5.0, which rejects such a URI during CIMD document validation so it never reaches a registered set; this predicate now refuses it independently, so the two are separate barriers rather than one.

  • Settle the CIMD same-origin requirement before any response travels to the redirect URI. It previously ran only after the whole authorization request had validated, so a request that failed an ordinary check — a missing code_challenge, say — short-circuited ahead of the gate and carried a redirectable error, with the client's state and the issuer, to a cross-origin URI the gate would have refused. The payload never included a code or token, and the destination was one the validated document declared.

    A failed origin check now makes the error direct, exactly as an unregistered redirect_uri already was. When the check passes, ordinary validation errors stay redirectable as before.

Added

  • Recognize the OpenID Connect Registration §2 application_type member ("web" | "native", defaulting to "web") at the dynamic registration endpoint, and carry the validated value through to :register_client in the client metadata. This is the standard wire signal a client uses to declare itself an installed app, so a host can now answer AttestoPhoenix.ClientStore.client_native?/1 from a registration rather than classifying every native client by hand — connecting dynamic registration to the RFC 8252 profile added in 2.2.0. An application_type outside the defined set is rejected with invalid_client_metadata.

    Required by the MCP 2026-07-28 authorization specification (SEP-837), which calls this out as the reason authorization servers reject desktop and CLI clients' redirect URIs.

Security

  • Serve RFC 8252 native apps that identify via a Client ID Metadata Document. CIMD clients were hardcoded as never-native (client_native? and redirect_uri_matching both short-circuited on {:cimd, _}) on the reasoning that a CIMD client "is identified by an https URL resolving to a document served over the network, not an installed app". That reasoning was wrong: the document is served over the network for every CIMD client — it is the mechanism, not a client-type signal — and it is hosted by the vendor's backend while the app is still installed on the user's device.

    Two defaults refused such a client, and both had to change:

    • The same-origin requirement between the client_id URL and the redirect_uri is now waived for a loopback redirect URI. A CIMD client_id is https by definition, so http://127.0.0.1/cb can never share its origin — the check was not a policy a native client failed but one no installed app could satisfy by construction. It is retained in full for https redirect URIs, which is where its anti-impersonation value lies.
    • Redirect matching for a CIMD client is now :exact_allow_loopback_port when the document itself declares a loopback redirect URI, so an ephemeral port bound at runtime matches a portless registration (RFC 8252 §7.3, whose applicability CIMD §4.2 inherits via RFC 9700 §4.1.3). A document declaring only https URIs, or only the localhost name (§8.3 requires the literal IP), is unaffected.

    The signal is the document's own declared redirect_uris, deliberately not an application_type member: CIMD defines no such member, whether it inherits OpenID Connect's is an open question on the draft's tracker, real documents do not carry it, and the passthrough allowlist would drop it. Declared redirect URIs are validated document content; a claimed type would not be.

    What is given up is same-origin binding for loopback redirects — any CIMD document may declare one and receive a code on the user's own machine. The attacker must already run code on the device to hold the port, and PKCE is mandatory for every CIMD client, so the exposure is bounded; deployments that want the old posture can set client_id_metadata: [require_same_origin_redirect_uri: true] alongside native_apps: [loopback_redirect: false], which forbids the port allowance server-wide.

  • Stop a crashing request from destroying the ETS-backed stores. Both AttestoPhoenix.Store.PAR.ETS — the default :par_store — and AttestoPhoenix.ClientIdMetadata.Cache.ETS started their table-owner process with GenServer.start_link/3 from whichever caller touched the store first. In a running server that is an ordinary request process, and a link carries abnormal exits, so any unhandled exception, timeout, or shutdown in that request killed the owner and destroyed its ETS table. For the PAR store that discarded every stored request_uri on the node, breaking in-flight authorization for every client at once, triggered by one unrelated request crashing. The owner is now started unlinked, and an :already_started pid is checked for liveness (a registered name can briefly outlive its process).

Added

  • AttestoPhoenix.ClientIdMetadata.Cache gains optional AttestoPhoenix.ClientIdMetadata.Cache.delete/1 and AttestoPhoenix.ClientIdMetadata.Cache.delete_all/0 callbacks, implemented by both shipped caches — the Postgres-backed Cache.Ecto (the default, where eviction is cluster-wide) and the per-node Cache.ETS — plus Cache.evict/2 and Cache.evict_all/1 which dispatch through the configured module and report {:error, :not_supported} for a custom cache that cannot evict.

    A cached CIMD document is otherwise honored until its expires_at, up to 24 hours under the default :cache_ttl_bounds, which is the wrong behavior once a document is known to have rotated or be compromised: the stale copy keeps authorizing the client with superseded jwks, redirect_uris, and auth metadata. The callbacks are optional, so an existing custom Cache implementation continues to compile unchanged.

Fixed

  • Accept the canonical RFC 8252 §7.1 private-use scheme redirect URI at the dynamic registration endpoint. com.example.app:/oauth2redirect carries no authority, and registration required a non-empty host, so the FIRST redirect type RFC 8252 prescribes for a native app could be registered by hand but never through POST /register — even though Attesto.RedirectURI matches it correctly at the authorization endpoint. RFC 6749 §3.1.2's "absolute URI" does not require an authority (RFC 3986 §4.3).

    The authority-less form is admitted only for a client that declared application_type: "native", and only when its scheme contains a dot and it carries a non-empty path. Those are necessary for the §7.1 convention (a reverse-ordered domain name under the app author's control, per RFC 7595 §3.8) but not sufficient to prove that control — nothing syntactic is. What they do buy is keeping the authority-less door shut for web clients entirely and keeping out the schemes that must never be a redirect target, javascript: and data: among them.

  • Reject a redirect URI carrying a fragment at the registration endpoint, for every client type. RFC 6749 §3.1.2: "The redirection endpoint URI MUST NOT include a fragment component."

  • Reject an explicit JSON null application_type rather than reading it as the "web" default; an absent member still defaults.

[2.3.0] - 2026-07-28

Changed

  • RFC 8252 §7.3 loopback interface redirection now follows from marking a client native (:client_native?) alone. native_apps: [loopback_redirect: ...] is no longer a gate that must be opened; it is an opt-out, defaulting to true.

    2.2.0 required both a server-wide flag and the per-client mark. §7.3 states the port allowance as a MUST, so refusing a native client's ephemeral port made the server non-conformant for a client the host had already declared to be an installed app.

    What keeps the profile off for an unconfigured deployment is unchanged and was never the flag: :client_native? itself defaults to false, so a host that classifies no clients has no native clients.

    Setting loopback_redirect: false still forbids the exception server-wide, as an operator kill switch or for a deployment certifying against a profile that mandates exact redirect-URI matching.

    reject_embedded_user_agents is unaffected and remains a genuine opt-in flag: §8.12 is a heuristic SHOULD and a server-wide posture rather than a per-client property.

  • :native_apps options are now validated at config build. A non-boolean member value, or an unrecognized member (a typo'd :loopbak_redirect), raises ArgumentError instead of being silently ignored. This matters because :loopback_redirect is the switch an operator reaches for to forbid a relaxation: native_apps: [loopback_redirect: System.get_env("X", "false")] yields the string "false", which must not be mistaken for "enabled". The predicate itself now reads strictly (== true), matching every other flag in AttestoPhoenix.Config; only the default differs.

Upgrading from 2.2.0

Behavior changes only where a client is marked native — :client_native? still defaults to false, so a deployment that classifies no clients is entirely unaffected.

Where native clients do exist, these configuration shapes gain the §7.3 exception that 2.2.0 withheld: :native_apps omitted entirely; native_apps: []; native_apps: nil; and native_apps: [reject_embedded_user_agents: true] (a host that configured the group for §8.12 only). loopback_redirect: true becomes a no-op and false keeps its meaning, so an explicit setting is unchanged either way.

Check whether your :client_store exports client_native?/1

2.2.0 noted that a :client_store module already exporting a function of that name — meaning "native to our platform", "first-party" — would be read as the RFC 8252 classification. In 2.2.0 the consequences were restrictions (forced PKCE, refused client secrets), which a public + PKCE client would not have noticed. In 2.3.0 the same accidental mark also widens redirect-URI matching: any such client with a loopback redirect URI registered — a routine http://127.0.0.1:3000/callback dev entry alongside the production one — will accept the authorization code on any port on 127.0.0.1.

If your client store exports client_native?/1 for an unrelated purpose, rename it, or set the flat :client_native? config key to a function returning false, before upgrading.

[2.2.0] - 2026-07-28

Upgrade note

  • client_native?/1 is a new optional AttestoPhoenix.ClientStore callback, resolved automatically from an installed :client_store module the same way every other client callback is. If your client-store module already exports a function of that name meaning something else — "native to our platform", "first-party", and so on — it will now be read as the RFC 8252 native-app classification, which forces PKCE for those clients and refuses their client secrets at every endpoint. Rename it, or set the flat :client_native? config key to a function returning false, before upgrading. Hosts with no such function are unaffected.

Added

  • RFC 8252 (BCP 212) native-app profile support, keyed on a new :client_native? client-store callback ((client -> boolean()), defaulting to false) and a new :native_apps option group. Every part of it is off until the host classifies its clients, so an existing deployment's behavior is unchanged.

    With a client marked native, two restrictions apply and need no flag: PKCE is required for it regardless of the global :require_pkce setting (§8.1; S256-only and no plain were already unconditional), and a client marked both native and public may only authenticate at the token endpoint with none — client_secret_basic, client_secret_post, and private_key_jwt are refused with the usual generic invalid_client (§8.4), because a credential shipped inside an installed binary is not confidential. Only a native client the host explicitly classifies as confidential keeps the secret path, that being the per-instance-credential case §8.4 carves out for dynamic registration. Where no :client_public? callback is configured at all, a client marked native counts as public — so wiring :client_native? alone gets §8.4 enforcement rather than silently accepting a shipped secret, and the same client is still admitted on none + PKCE. An unclassified non-native client remains confidential, unchanged.

    Two rules are additionally opt-in through :native_apps:

    • loopback_redirect: true enables RFC 8252 §7.3 loopback interface redirection for native clients: an http://127.0.0.1/... or http://[::1]/... redirect URI matches the registered one on any port, so an ephemeral port bound at runtime needs no registration, while scheme, host, path, and query still compare exactly. Nothing else is relaxed — https, private-use schemes, remote hosts, non-native clients, and the hostname localhost (forbidden by §8.3) stay byte-exact, and an unmatched redirect URI is still a direct, non-redirectable error. This widens a check the OpenID Connect and FAPI profiles assume is exact, so enabling it is incompatible with certifying against them; it requires both the server-wide flag and the per-client mark.
    • reject_embedded_user_agents: true enables the RFC 8252 §8.12 refusal of authorization requests that appear to come from an in-app webview, via the new AttestoPhoenix.RequestContext.embedded_user_agent?/1 and check_embedded_user_agent/2. Detection is a User-Agent heuristic and is documented as defense in depth rather than a boundary, which is why it is opt-in; it applies to all clients, since the embedding app need not be the OAuth client.

    Also adds AttestoPhoenix.AuthorizationServer.RequestPolicy.redirect_uri_matching/2 and client_native?/2, and AttestoPhoenix.Config.native_apps/1, native_app_loopback_redirect?/1, and reject_embedded_user_agents?/1.

Security

  • Bind a pushed authorization request to the client that actually authenticated (RFC 9126 §2.1). AttestoPhoenix.AuthorizationServer.PAR.Request now carries the identifier from AttestoPhoenix.ClientAuthentication.Result, and the stored record is bound to it whenever the optional :client_id callback does not resolve one. Previously the request body's own client_id was left in place in that case, contrary to the documented contract that it is "never trusted from the request body". Because the stored record is later resolved at the authorization endpoint against the client named in it, an authenticated client could push a request naming a different client and have the authorization endpoint issue a code for that client while the redirect_uri had only been validated against the pusher's registered set — a confused deputy reachable by any deployment that exposes no :client_id callback.

    Relatedly, a pushed client_id that disagrees with the authenticated client is now rejected with invalid_request rather than silently rewritten, matching how the token endpoint already treats a conflicting client_id. The check runs on the effective parameters, so one carried only inside a signed request object is covered. A client that pushes its own client_id — every conforming client — is unaffected.

  • Verify a pushed signed request object (RFC 9101) against the bound client identifier rather than the host :client_id callback alone. A deployment exposing no such callback previously verified every pushed request object against a nil issuer, which Attesto.RequestObject treats as unverifiable, so PAR + JAR was rejected outright as invalid_request_object for those hosts.

  • Apply the RFC 8252 §8.4 client-authentication restriction at the revocation endpoint too. It parses credentials itself rather than going through AttestoPhoenix.ClientAuthentication, so without this it would be a second authentication surface accepting a secret the token endpoint refuses. No effect on a deployment that exposes no :client_native? callback.

Changed

  • Raise the test-only Bandit floor to 1.12.1, excluding the releases affected by the quadratic-time WebSocket fragment-reassembly denial of service (EEF-CVE-2026-65623, introduced in 1.11.0). Test-only, so no published consumer was ever exposed.
  • Require attesto ~> 1.4, which carries Attesto.RedirectURI and the :redirect_uri_matching validation option this release depends on. Against an older attesto the loopback option would be silently ignored rather than refused, so the floor is raised rather than left at 1.3.

[2.1.0] - 2026-07-25

Added

  • Add :client_auth_enforce_fapi_alg_policy and the corresponding CIBA :enforce_fapi_alg_policy option. Omitted algorithm lists retain FAPI key enforcement, while an explicit list remains an intentional non-FAPI policy unless the host opts back into enforcement.
  • Advertise RFC 9864 Ed25519 alongside legacy EdDSA in the default client assertion and request-object algorithm metadata.
  • Advertise introspection_endpoint_auth_signing_alg_values_supported from the same client-assertion policy enforced by the introspection endpoint.
  • Add a minimum-version consumer smoke test without Req so optional dependency regressions fail CI. It covers disabled, active-default, and custom-adapter configurations and fails CI on any compiler warning from AttestoPhoenix against the minimum dependency set.

Fixed

  • Compile the bundled Back-Channel Logout and CIBA ping Req implementations only when the optional Req dependency is available, matching the Client ID Metadata fetcher. Consumers that supply their own HTTP implementations can now compile without adding Req. Enabled features validate the selected adapter module and callback at configuration time; a missing bundled Req adapter gets actionable dependency guidance instead of crashing on the first outbound request.
  • Correct the CIBA ping documentation to use the top-level :ciba_ping_http_client configuration key.
  • Reject CIBA :push delivery at configuration time because AttestoPhoenix has no push deliverer. Advertising an undeliverable mode could leave an approved request with no notification and no polling fallback.
  • Reject malformed signing-algorithm lists and enforced lists that contain algorithms outside Attesto's FAPI set, preventing discovery metadata from advertising an algorithm the corresponding verifier must reject.

Security

  • Enforce the FAPI RSA modulus and Edwards-curve policy through every private_key_jwt endpoint and CIBA signed-request validation. The default rejects PS256 keys below 2048 bits and legacy EdDSA over Ed448; named and narrowed FAPI request-object policies retain the same checks.
  • Restrict Phoenix and Plug requirements to advisory-patched releases across every supported minor line. This preserves the widest compatible dependency range without allowing a resolver to select a known-vulnerable version.
  • Raise the Attesto runtime floor to 1.3.0 for key-bound FAPI enforcement and RFC 9864 Edwards identifiers. The floor also retains the transitive JOSE and Plug compatibility and security boundaries from Attesto 1.2.5. Raise the development/test Postgrex floor to 0.22.3.

[2.0.2] - 2026-07-16

Changed

  • Upgrade note: a configured :client_id callback must now return exactly the identifier carried by the successfully verified client credentials. A callback that maps the authenticated client to a different canonical or internal identifier now fails authentication with generic invalid_client. Keep internal identifiers on the opaque client value returned by :load_client; use :client_id only to confirm its OAuth identifier.

Fixed

  • The introspection endpoint now recognizes access tokens minted for trusted RFC 8707 resource indicators. It derives the accepted audience set from the configured default audience plus static and signed original-token-client resource allowlists, while unknown resources and partially untrusted audience arrays remain inactive. The introspection caller remains a separate authorization decision.
  • Token exchange now accepts trusted resource-audienced subject tokens and stamps the authenticated exchanger's client_id instead of inheriting the subject token's client. An omitted resource preserves and re-authorizes the complete subject audience rather than falling back to the server default.
  • Every token-endpoint grant now uses one immutable, credential-carried client_id for state redemption, access and ID Tokens, refresh families, and audit. Host callbacks may confirm that identifier but cannot relabel an authenticated client, and trusted direct callers retain their legacy builder claim fallback.
  • Invalid static resource indicators and callback configuration now fail at boot; malformed dynamic callback entries are ignored safely.

Security

  • Raise the direct Plug dependency floor to 1.19.5, matching Attesto core and excluding releases affected by multipart temp-file exhaustion, nested-parameter quadratic-time denial of service, and cookie attribute-injection advisories.

[2.0.1] - 2026-07-16

Security

  • Raise the optional Req dependency floor to 0.6.1, the first release patched for EEF-CVE-2026-49755 decompression-bomb denial of service. The built-in Client ID Metadata, CIBA ping, and back-channel logout HTTP implementations can receive responses from remote endpoints and now cannot resolve with an affected Req release.
  • Replace the test-only Bypass/Cowboy origin servers with a local Bandit-backed helper, removing the advisory-affected Cowlib dependency from the development lock and CI audit surface.

Documentation

  • Clarify that :require_https controls incoming request transport checks; it never relaxes the standards-required HTTPS issuer and advertised endpoint validation.

[2.0.0] - 2026-07-15

Why this is a major release. The released 1.4 public contract accepted absolute non-HTTPS endpoint overrides, and UserInfo did not apply the existing :require_https policy. The security and conformance corrections below can therefore fail a previously accepted configuration at startup or change an HTTP UserInfo response from success to rejection. They are incompatible behavior changes under this project's declared Semantic Versioning policy, even though the old behavior was not standards-conformant.

Added

  • attesto_routes/1 accepts userinfo: false and openid_configuration: false as independent, compile-time route-mount controls. Both default to true, so existing calls retain the exact route table and pipeline data; OAuth-only hosts can omit the OIDC-only surfaces without restating the authorization-server routes. Disabling OpenID configuration does not remove or alter RFC 8414 authorization-server metadata.
  • :userinfo_endpoint accepts :derived as an explicit derivation marker for the issuer/path-derived bundled UserInfo URL. With userinfo: false, only this derived value can be suppressed when it is route-equivalent to the removed local endpoint. An explicit HTTPS URL is always authoritative, including at the same path, so a host can replace the bundled controller without losing Provider Metadata; nil retains its released omission behavior. Suppression follows Phoenix/Plug dispatch semantics for prefixes, static and dynamic scopes, empty path segments, trailing/repeated slashes, percent-decoded request segments, dot segments, non-default ports, and forwarded router mounts. A dynamic macro :prefix is rejected when userinfo: false is combined with openid_configuration: true, because the retained Provider Metadata route cannot resolve that prefix; a surrounding dynamic Phoenix scope remains supported.
  • AttestoPhoenix.Config accepts a :resource_metadata_resolver callback that selects an RFC 9728 protected-resource metadata URI for each request or returns nil to omit it. AttestoPhoenix.Plug.Authenticate and UserInfo use the selected URI consistently across core verification, revoked-token, insufficient-scope, and transport failures. The existing static :resource_metadata URL remains the backward-compatible fallback when no resolver is configured. Function, {module, function}, and {module, function, extra_args} forms are supported; extra arguments follow the request argument. Configuration validates MFA callbacks and their effective arity. Invalid runtime resolver values are safely omitted; an explicit per-Plug override, including nil, skips the resolver; and a resolver exception deliberately propagates and fails the request.

Changed

  • Breaking — advertised URL validation. AttestoPhoenix.Config.new/1 now requires an HTTPS issuer with a host and no query or fragment, and requires explicit :authorization_endpoint and :userinfo_endpoint URLs to use HTTPS with a host and no fragment. Previously accepted insecure or malformed values now raise ArgumentError during configuration. Migrate production and local issuers/endpoints to HTTPS, remove query/fragment components from the issuer, and use the locally trusted certificate workflow in guides/local_https.md for development. Endpoint query components remain supported.
  • Breaking — UserInfo transport enforcement. UserInfo now applies :require_https before token verification or claim release. A deployment that terminates TLS at a proxy must configure the immediate proxy in :trusted_proxies so its forwarded HTTPS scheme is trusted; do not disable HTTPS in production.
  • Potentially breaking — static Plug option validation. A non-nil resource_metadata: option passed directly to AttestoPhoenix.Plug.Authenticate is now validated by init/1 and raises for an invalid URL. Phoenix runs Plug initialization at compile time by default; hosts using runtime Plug initialization see the same error when the Plug is initialized. Fix the URL or use explicit nil. Invalid runtime resolver returns are still safely omitted, while a resolver exception deliberately propagates and fails the request.

Fixed

  • UserInfo now honors the configured error transport hooks on verification, TLS, revoked-token, and insufficient-scope failures. UserInfo also now honors bearer_methods_supported (previously it accepted header credentials only, regardless of configuration): a host advertising "body" will see UserInfo begin accepting RFC 6750 §2.2 form-body tokens as advertised.
  • An explicit per-plug :resource_metadata value (including nil) and error transport hooks now take precedence consistently across core verification, TLS, revocation, and principal-resolution failures.
  • OpenID Provider Metadata now derives the required authorization_endpoint when no override is configured, and both OAuth and OpenID metadata honor the same validated external override.

Security

  • Issuer and advertised endpoint validation now enforces the HTTPS requirements of RFC 8414 and OpenID Provider Metadata, and UserInfo no longer accepts or releases Bearer-token claims over an insecure transport when HTTPS is required. These security fixes are also the breaking changes called out above.

[1.4.0] - 2026-07-15

Added

  • attesto_routes/1 accepts route_pipelines: overrides for the documented :metadata, :interactive, and :protocol route classes. Each atom or ordered atom list replaces the legacy pipeline: default for that class, allowing browser/resource-owner support to remain separate from public metadata and externally submitted OAuth protocol requests. Calls without the new option retain the existing route table and pipeline data.

Fixed

  • route_pipelines: now rejects nil values and module-attribute pipeline expressions with actionable compile-time errors instead of silently treating nil as an empty pipeline list or exposing Phoenix's internal attribute AST.

[1.3.0] - 2026-07-13

Added

  • RFC 9728 conformance: the path-inserted protected-resource metadata URI. attesto_routes/1 grows protected_resource_paths: ["/mcp"], mounting the RFC 9728 §3.1 path-inserted well-known form (/.well-known/oauth-protected-resource/mcp) alongside the root document. Clients that derive that form from the resource URL (current MCP clients probe it first, before the WWW-Authenticate resource_metadata fallback) previously missed a host serving only the root URI. The controller enforces RFC 9728 §3.3 fail-closed: the served resource member must equal the identifier the URI is derived from, so a mounted path that disagrees with the configured resource identifier raises at first request instead of serving a document a conformant client is required to reject. More than one path is a compile-time error pointing at attesto_mcp's per-resource attesto_mcp_protected_resource_metadata/2.
  • attesto_routes/1 grows protected_resource_root: false to hand root PRM document ownership to attesto_mcp's macro in combined AS+RS apps, so each PRM route has exactly one owner.

[1.2.0] - 2026-07-08

Added

  • OpenID Connect CIBA (Client-Initiated Backchannel Authentication) — the Phoenix layer. The backchannel authentication endpoint (/bc-authorize), poll and ping token delivery, the §10.2 ping notification deliverer, and an Ecto-backed CIBA request store. Certified FAPI-CIBA ID1 in both poll and ping delivery modes.
  • Local HTTPS for development. AttestoPhoenix.DevTLS.https_opts/1 wires a mkcert certificate into a Phoenix dev endpoint in one line, and mix attesto_phoenix.gen.dev_https generates it — so an app can develop against attesto's required https issuer with no tunnel and no downgrade. New guides/local_https.md; the installer points at it.

Changed

  • Discovery advertises tls_client_certificate_bound_access_tokens when mTLS is enabled (RFC 8705 §3.3).
  • The token endpoint and the CIBA backchannel endpoint accept the issuer identifier, the token-endpoint URL, or the endpoint's own URL as a private_key_jwt client-assertion audience (RFC 7523 §3).
  • The CIBA client_notification_token is stored as :text (CIBA §7.3 sets no length bound); requires a fresh migration via mix attesto_phoenix.gen.migration.
  • The CIBA ping notification channel offers TLS 1.3 (FAPI transport).

Fixed

  • The UserInfo endpoint now adapts a {module, function} :cert_der callback to the bare function Attesto.Plug.Authenticate requires, so mTLS certificate-bound tokens are correctly enforced at the resource server (a presented certificate that does not match the token's cnf.x5t#S256 is rejected).

[1.1.0] - 2026-07-07

Added

  • OpenID Connect Front-Channel Logout 1.0 (OP side).
    • The end-session endpoint renders every front-channel-capable RP's registered frontchannel_logout_uri in a hidden iframe on the logout page (with iss/sid whenever the session's sid is known), then completes the RP-Initiated flow from the page itself: with a validated post_logout_redirect_uri it continues there once the iframes have loaded (JavaScript with a bounded timeout, plus a meta-refresh and a visible link as no-JS fallbacks); with no return URI the page is the logged-out page. The iframes and the back-channel logout_token POSTs are driven by the same atomically-taken logout-session rows, so a session is fanned out exactly once. A non-browser caller cannot run iframes, so front-channel targets are skipped (logged) and the response is unchanged.
    • The token endpoint records a logout session at ID-Token mint for any client that registered a frontchannel_logout_uri and/or a backchannel_logout_uri (previously back-channel only). AttestoPhoenix.Schema.LogoutSession / EctoLogoutSessionStore carry the new frontchannel_logout_uri / frontchannel_session_required columns, backchannel_logout_uri is now nullable, and the migration template reflects the new shape.
    • Client registry: new :client_frontchannel_logout_uri / :client_frontchannel_logout_session_required Config callbacks (and optional AttestoPhoenix.ClientStore callbacks). A non-https frontchannel_logout_uri is treated as absent (browsers block it as mixed content on the https logout page), a deliberate tightening of the spec's http-for-confidential-clients allowance.
    • Dynamic registration passes frontchannel_logout_uri (string) and frontchannel_logout_session_required (boolean) through to the host store (Front-Channel Logout 1.0 §2).
    • Discovery advertises frontchannel_logout_supported / frontchannel_logout_session_supported when logout is enabled and a :logout_session_store is wired.
  • OpenID Connect Session Management 1.0 (OP side).
    • session_management: [enabled: true] turns the feature on; attesto_routes(session_management: true) mounts GET /oauth/check_session, the §3.3 check_session_iframe served by the new AttestoPhoenix.Controller.CheckSessionController (a static page whose script recomputes session_state with crypto.subtle from the message's client_id, the sender's MessageEvent.origin, the OP browser-state cookie, and the received salt, replying unchanged/changed/error).
    • Successful authorization responses carry the §2 session_state parameter, computed by Attesto.SessionState over the redirect_uri's browser origin. (Deliberate deviation: the SHOULD-level session_state on authorization error responses is not emitted.)
    • AttestoPhoenix.BrowserState owns the JavaScript-readable OP browser-state cookie (SameSite=None; Secure, not HttpOnly): minted at the authorization endpoint when absent (login), expired at the end-session endpoint (logout), so a post-logout recomputation yields changed.
    • Discovery advertises check_session_iframe when the feature is enabled.

[1.0.0] - 2026-07-04

First stable release; the public API is now under semantic versioning. No functional change from 0.20.0. Requires attesto ~> 1.0.

The Phoenix/Ecto authorization-server layer drives an OpenID Provider that passes the OpenID Foundation conformance suite for OpenID Connect Core (Basic), FAPI 2.0 Security Profile Final, FAPI 2.0 Message Signing Final, RP-Initiated Logout, and Back-Channel Logout.

[0.20.0] - 2026-07-01

Changed

  • End-session endpoint now content-negotiates its responses. The browser-facing /oauth/end_session errors (invalid post_logout_redirect_uri, invalid id_token_hint, ...) and the default logged-out response rendered JSON to every caller; a browser (Accept: text/html) now gets a minimal human-readable HTML page instead, while non-browser callers keep the JSON body — matching the authorization endpoint's direct-error handling. A wired :render_logged_out callback still takes precedence.

[0.19.1] - 2026-06-26

Fixed

  • Authorization-endpoint direct-error HTML showed the wrong code. A non-redirectable /authorize error rendered to a browser (Accept: text/html) hardcoded invalid_request in the page, while the JSON body correctly carried the resolved code. A browser hitting an expired/unknown PAR request_uri therefore saw invalid_request instead of invalid_request_uri (which a conformance check reading the rendered page rejects). The HTML page now renders the same resolved code as the JSON body.

[0.19.0] - 2026-06-23

Added

  • Dynamic-registration default scope (RFC 7591 §2). A new :registration_default_scope config assigns a scope to a client that registers without one — :scopes_supported for the full catalog, or an explicit list (validated against :scopes_supported at boot) — echoed back in the §3.2.1 response so the client learns what it got. Default nil keeps the prior fail-closed behavior (a scopeless registration stays scopeless). This lets a scopeless DCR client (e.g. an MCP/agent client) register with a usable scope as protocol behavior, rather than each host's authorize_scope fallback reinventing it.

Changed

  • Token-endpoint error diagnostics. POST /oauth/token now logs the resolved RFC 6749 §5.2 error code + description at :debug at the single render boundary, so a host operator can tell e.g. invalid_scope from invalid_grant behind an otherwise-opaque 400 without reading the source. The level is :debug so a 4xx under load is never prod log noise; the structured :token_denied event still carries the same reason for hosts that want it louder.

[0.18.0] - 2026-06-23

Added

  • OpenID Connect Logout (RP-Initiated Logout 1.0 + Back-Channel Logout 1.0). A logout: true option on attesto_routes/1 mounts GET/POST /oauth/end_session (AttestoPhoenix.Controller.EndSessionController), gated by a logout: [enabled: true] config block. The endpoint verifies the id_token_hint, validates post_logout_redirect_uri against the client's registered set (exact match — no open redirect), and either redirects with state or hands off to the host's logged-out page.

    • The host is the session authority: a REQUIRED :terminate_session callback clears the browser session and returns the confirmed %{sid, subject} that scopes the Back-Channel fan-out — so a replayed or stolen id_token_hint cannot force-log-out an arbitrary session. AttestoPhoenix.Config raises at boot if logout is enabled without it (no fail-open logout). :render_logged_out is an optional page renderer.
    • Back-Channel fan-out: a logout_token is POSTed to every RP holding the terminated session, recorded at ID-Token mint (AttestoPhoenix.Schema.LogoutSession + EctoLogoutSessionStore, a new attesto_logout_sessions table) and taken atomically (DELETE ... RETURNING) so concurrent logouts cannot double-deliver. Delivery (AttestoPhoenix.BackChannelLogout / .Req) is best-effort and SSRF-guarded: a backchannel_logout_uri is honored only when it is https with no userinfo/fragment and a non-internal host (loopback / RFC 1918 / link-local / ULA literals are refused).
    • The authorization endpoint threads the host's :sid (from the authenticate subject map) into the ID Token, and dynamic registration accepts post_logout_redirect_uris, backchannel_logout_uri, and backchannel_logout_session_required. Discovery advertises end_session_endpoint + backchannel_logout_supported + backchannel_logout_session_supported when enabled. The sweeper reaps expired logout-session rows.
  • Requires attesto ~> 0.13.

[0.17.0] - 2026-06-23

Added

  • RFC 8628 Device Authorization Grant. A device: true option on attesto_routes/1 mounts POST /oauth/device_authorization and the GET/POST /oauth/device_verification page; the token endpoint gains a device_code grant dispatch (the §3.5 polling errors render with their own codes, not collapsed to invalid_grant). A PUBLIC (:none) client MUST present a DPoP proof at the device-authorization endpoint (a device-issued bearer token has no PKCE/redirect backstop), and the bound RFC 8707 resource / RFC 9470 acr+auth_time thread through to the minted token. New device_authorization config block + :device_code_store, the AttestoPhoenix.Store.EctoDeviceCodeStore (every transition a single guarded atomic UPDATE) + attesto_device_codes table, the :authenticate_device_user / :render_device_verification host callbacks, and device_authorization_endpoint advertised in discovery when enabled.

Changed

  • Requires attesto ~> 0.12.

[0.16.0] - 2026-06-22

Added

  • RFC 9470 Step-Up Authentication. The token endpoint mints the authentication context (acr / auth_time) onto access tokens so a resource server can enforce a step-up requirement: authorization_code mints them from the redeemed code's claims, and the refresh family persists and replays the ORIGINAL acr / auth_time (never re-stamped on rotation). A machine grant establishes no auth context and so fails closed against any step-up requirement. New acr / auth_time columns on attesto_refresh_tokens (migration generator + schema).

Changed

  • Requires attesto ~> 0.11.

Fixed

  • Refresh-family revocation race (security). AttestoPhoenix.Store.EctoRefreshStore now serializes insert/1 and revoke_family/1 for a given family with a Postgres advisory transaction lock. Previously, under READ COMMITTED, a successor insert could interleave with a concurrent family revocation and leave a live token in a revoked family (a FOR UPDATE on existing rows would not catch the just-inserted successor — a phantom). Sticky family revocation (RFC 6749 §10.4 / OAuth 2.0 Security BCP) now holds under concurrency.

[0.15.0] - 2026-06-22

Added

  • RFC 8707 Resource Indicators across every grant. client_credentials, token exchange, and jwt-bearer validate (§2.1) and authorize (§2.2) the request-time resource and mint the access-token aud from it; authorization_code binds the resource authorized at the authorize endpoint and mints aud from it (optionally narrowed at redemption, never widened); refresh_token carries and subset-narrows it. Multiple allow-listed resources mint a JWT aud array; an unserved resource is invalid_target.
  • Grant-agnostic resource_indicators: [allowed_resources, allowed_resources_for] config and AttestoPhoenix.Config.allowed_resources/2 (server :audience + static list + optional per-client callback), replacing the jwt-bearer-only jwt_bearer: [allowed_resources].
  • A resource column persisted on the authorization-code and refresh-token stores (migration generator + schemas).

Security

  • Token exchange now ceilings a requested resource to the subject token's own aud (RFC 8693 §2.1 / RFC 8707): a token confined to resource A can no longer be exchanged for one audienced to a sibling resource B.

Changed

  • Requires attesto ~> 0.10.

[0.14.2] - 2026-06-22

Fixed

  • AttestoPhoenix.RequestContext now folds an IPv4-mapped IPv6 peer address (::ffff:a.b.c.d) back to its IPv4 tuple before testing it against :trusted_proxies. A dual-stack listener bound on :: (the common Docker / Kamal topology, where a TLS-terminating reverse proxy reaches the app over an IPv4 bridge network) surfaces the proxy peer as ::ffff:172.x.y.z, which an IPv4 CIDR allowlist (e.g. 172.16.0.0/12) never matched — so the proxy was treated as untrusted, X-Forwarded-Proto: https was ignored, and a legitimately TLS-terminated request to the token / protected-resource endpoint was misread as plain HTTP and refused with invalid_request ("TLS required"). The fold makes the forwarded-header trust gate work behind such a proxy without widening the allowlist to IPv6.

[0.14.1] - 2026-06-22

Fixed

  • AttestoPhoenix.Store.NonceStore now calls the Attesto.DPoP.NonceStore behaviour callback issue/1 (with an explicit TTL) on its config-free fallback, instead of an arity-0 issue/0 that the behaviour does not guarantee. A third-party nonce store implementing the behaviour exactly (issue/1 only, without an arity-0 convenience) is now dispatched correctly rather than crashing in the fallback. The bundled ETS and Ecto stores are unaffected. Doc corrected to stop referring to a non-existent issue/0.
  • The token endpoint now rejects a request carrying more than one DPoP header outright with invalid_dpop_proof (RFC 9449 §4.3), rather than silently selecting one proof — closing a header-smuggling vector where an intermediary could inject an attacker's proof.
  • An unparseable client certificate at the token endpoint now returns invalid_request ("invalid client certificate") rather than invalid_client: non-X.509 bytes are a malformed request parameter (there is nothing to bind a token to), not a client-authentication failure.
  • The token-endpoint denial path no longer raises when the request body was never parsed (e.g. a rejected/unsupported Content-Type leaves body_params an %Plug.Conn.Unfetched{} struct). It now falls back to the action params instead of treating the struct as parsed params and raising on key access.

[0.14.0] - 2026-06-22

Security

  • AttestoPhoenix.AuthorizationServer.SenderConstraint.resolve/3 now resolves a client's REQUIRED sender constraint before any opportunistic binding, so a required constraint can no longer be satisfied by presenting a DIFFERENT valid one. Previously the first opportunistically-present constraint was bound before the client's requirement was checked: a DPoP-required client that presented a client certificate (and no proof) was issued an mTLS-bound token, and symmetrically an mTLS-required client presenting a DPoP proof was DPoP-bound — defeating the per-client policy. Now a DPoP-required client is bound only by a DPoP proof (a certificate-only request is rejected with DPoP proof required), an mTLS-required client only by a certificate (a proof-only request is rejected with client certificate required), and a client requiring neither keeps the existing opportunistic precedence (DPoP over mTLS, else Bearer).

Fixed

  • The token-endpoint and resource-server DPoP paths now accept a {module, function} / {module, function, extra_args} MFA :replay_check. The configured callback was passed verbatim to Attesto.DPoP.verify_proof/2, which requires a bare 2-arity function, so a host configuring an MFA replay store (the only form config can hold) crashed with an ArgumentError on every DPoP request. All four DPoP verify sites — token endpoint, PAR, UserInfo, and the Authenticate plug — now adapt the callback via AttestoPhoenix.Callback.to_fun2/1.
  • dpop_nonce_required: true no longer crashes when AttestoPhoenix.Config is configured under the host's own otp_app. The DPoP paths now thread the live request config into nonce issuance and validation instead of letting the nonce store re-resolve config from a hardcoded :attesto_phoenix otp_app (which raised when the host configured the library elsewhere). A persistent nonce store such as AttestoPhoenix.Store.EctoNonceStore receives the resolved config and never has to guess an otp_app.

Added

[0.13.5] - 2026-06-21

Added

  • :token_denied events now carry richer audit metadata: :client_id when known, structured :reason as the OAuth error atom, and sender-constraint fields mirroring issuance events (:token_type, :sender_constraint, and :cnf).
  • AttestoPhoenix.AuthorizationServer.SenderConstraint.audit_metadata/2 exposes the shared sender-constraint audit classification used by token denial events.

Changed

  • AttestoPhoenix.Controller.TokenController now rejects token requests whose Content-Type is not application/x-www-form-urlencoded or application/json before client authentication. Unsupported media types return 400 invalid_request naming the rejected Content-Type.

Fixed

  • Token endpoint invalid_client responses from Authorization-header client authentication now follow RFC 6749 §5.2: Basic/header failures return 401 with a matching WWW-Authenticate challenge, while body credentials and absent credentials remain 400 without a challenge.

[0.13.4] - 2026-06-21

Added

  • AttestoPhoenix.ConsentGrant.binding_from_params/2 builds the same canonical consent-grant binding as binding/2 from raw string-keyed OAuth params, so consent-screen mint actions and live /authorize consume callbacks no longer need duplicate host-side binding reconstruction.

[0.13.3] - 2026-06-21

Added

  • Token issuance events now include sender-constraint audit metadata. :token_issued events, plus the related :refresh_issued and :refresh_rotated issuance events, now preserve the mint-time sender constraint in event.metadata: :token_type ("Bearer" or "DPoP"), :sender_constraint (:none, :dpop, or :mtls), and :cnf (%{"jkt" => thumbprint}, %{"x5t#S256" => thumbprint}, or nil). Existing :client_ip metadata is unchanged.

[0.13.2] - 2026-06-21

Fixed

  • Consent grants now bind the PKCE code_challenge_method. AttestoPhoenix.ConsentGrant.binding/2 and binding_hash/1 now include code_challenge_method alongside code_challenge, so a grant consented for an S256 authorization request cannot be reused for an otherwise-identical plain request with the same challenge value. Missing PKCE fields continue to canonicalize as empty strings.

Compatibility

  • The consent-grant hash input changed. Any consent grant minted before this upgrade will not match after the upgrade. Consent grants are single-use and short-TTL, so the practical effect is limited to an in-flight authorization started across the upgrade re-prompting once.

[0.13.1] - 2026-06-21

Added

  • Optional OpenApiSpex token endpoint helpers. AttestoPhoenix.OpenAPI.TokenEndpoint now exposes reusable OpenAPI values for POST /oauth/token: operation/1, schemas/0, request_body/0, and responses/0. The documented surface covers RFC 6749 §4.4 client_credentials form requests, body client authentication, private_key_jwt, optional DPoP proof headers, Bearer and DPoP token success responses, OAuth error responses, and RFC 9449 invalid_dpop_proof / use_dpop_nonce with DPoP-Nonce. The :open_api_spex dependency is optional and the module compiles only when OpenApiSpex is available.

Changed

  • Token endpoint rejects credential-bearing query strings. AttestoPhoenix.Controller.TokenController now rejects grant_type, client_id, client_secret, or scope when any appears in the query string, before TLS validation, client authentication, or grant dispatch. The response is the normal RFC 6749 §5.2 400 invalid_request JSON envelope. The same fields remain accepted in the form body.

Fixed

  • Optional Req dependency remains optional for consumers. AttestoPhoenix.ClientIdMetadata.Fetcher.Req is now compile-guarded on Req being loaded, matching the existing optional dependency declaration and allowing a consumer that does not enable CIMD fetching to compile attesto_phoenix with --warnings-as-errors without depending on :req.

[0.13.0] - 2026-06-21

Changed

  • Protected-resource bearer credentials default to header-only. :bearer_methods_supported now defaults to ["header"], and AttestoPhoenix.Plug.Authenticate passes that setting through to the core verifier. Resource servers that intentionally accept RFC 6750 §2.2 form-body access_token credentials can configure ["header", "body"]; the runtime verifier and RFC 9728 metadata now use the same setting. Requires attesto ~> 0.9.

[0.12.0] - 2026-06-21

Added

  • Single-use, request-bound consent grants (RFC 6749 §4.1.1). A new authorization-server correctness primitive that ties one consent decision to the exact authorization request the resource owner saw, so an Authorize click cannot approve a different client, redirect URI, scope set, or PKCE challenge than the one displayed. Opt-in and additive — a host that does not wire it is unaffected.

Fixed

[0.11.0] - 2026-06-20

Added

  • AttestoPhoenix.Config :bearer_methods_supported — the RFC 6750 access-token presentation methods the resource server accepts, advertised as bearer_methods_supported in the RFC 9728 protected-resource metadata document (/.well-known/oauth-protected-resource). Previously the ProtectedResourceController hardcoded ["header", "body"], forcing a header-only deployment to advertise the form-body method (RFC 6750 §2.2) it rejects — a metadata-accuracy/interoperability defect, since a conformant client could select a rejected method (RFC 9728 §2 / RFC 6750 §3). The field is now configurable (a non-empty list of distinct methods, each "header" or "body" — exactly the surface AttestoPhoenix.Plug.Authenticate accepts: the Authorization header (§2.1) and a POST form-body access_token (§2.2); validated at config build), mirroring :scopes_supported. The §2.3 "query" method is rejected — the plug never accepts a query-presented token, so advertising it would be the same inaccuracy inverted (and RFC 6750 §2.3 says it SHOULD NOT be used). Defaults to ["header", "body"]; a header-only resource server sets ["header"].

[0.10.0] - 2026-06-20

Added

  • GET /.well-known/oauth-protected-resource endpoint (AttestoPhoenix.Controller.ProtectedResourceController). Serves the RFC 9728 protected-resource metadata document (resource, authorization_servers, scopes_supported, bearer_methods_supported), derived from the same issuer, audience, and scope configuration the RFC 8414 discovery document uses. Mounted by attesto_routes/1 at the host root (RFC 8615); it is the discovery target of the resource_metadata WWW-Authenticate challenge the protected-resource plugs emit, so a resource server is discovery-complete without the caller hand-rolling the document.

  • AttestoPhoenix.Config :resource_metadata. Absolute URL of this resource's RFC 9728 protected-resource metadata document. When set, AttestoPhoenix.Plug.Authenticate and the UserInfo endpoint advertise it as a resource_metadata auth-param on every WWW-Authenticate challenge they render (RFC 9728 §5.1), so a client refused with 401/403 can discover which authorization server issues tokens for this resource. Configured once on the Config; omitted from the challenge when unset.

  • AttestoPhoenix.Config.new/1 now validates :audience at boot. It must be a non-empty absolute https URL with a host and no fragment, not merely present. It is the access-token aud (RFC 9068 §3), the audience the protected-resource verifier requires (a mismatch is :invalid_audience), and the RFC 9728 resource identifier served at /.well-known/oauth-protected-resource — so a nil, blank, or non-URL value would either fail late (every token rejected :invalid_audience) or 500 the protected-resource metadata endpoint. new/1 now raises ArgumentError instead. With RFC 8707 resource handling the minted aud may differ per request, but config.audience remains the required default/fallback and RS verification audience.

  • Identity Assertion JWT Authorization Grant (ID-JAG / jwt-bearer) — the resource server's half of draft-ietf-oauth-identity-assertion-authz-grant-04, the grant behind MCP Enterprise-Managed Authorization (EMA). A token request with grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer and an assertion (an ID-JAG signed by a trusted enterprise IdP) is exchanged for a normal access token — no redirect, no consent.

    • Off by default, gated by jwt_bearer: [enabled: true, ...]. When enabled, urn:ietf:params:oauth:grant-type:jwt-bearer is advertised in grant_types_supported (both discovery documents) and accepted at the token endpoint; existing deployments are unaffected.
    • Trusted issuers (jwt_bearer: [issuers: %{...}]): each issuer supplies static :jwks, a cached :jwks_uri (fetched through the SSRF-guarded CIMD fetcher + cache), or a custom :jwks_resolver; with :allowed_algs and an optional :audience override. Assertions from unconfigured issuers are denied.
    • Validation via Attesto.IdentityAssertion: typ=oauth-id-jag+jwt, signature against the issuer JWKS, iss/aud/exp/iat (with skew), the required client_id binding to the authenticated client, and jti replay (reusing the configured :replay_check). Every failure is RFC 6749 §5.2 invalid_grant; a missing assertion is invalid_request.
    • Subject resolution via a new :resolve_jwt_bearer_subject callback (also installable as resolve_jwt_bearer_subject/1 on AttestoPhoenix.PrincipalStore): maps the validated claims to a local principal subject, or denies. Required at boot when the grant is enabled.
    • The grant requires client authentication (confidential clients only) and honours per-client grant_types. The assertion's scope claim is the granted-scope ceiling; :authorize_scope narrows from there.
    • No refresh token is issued for this grant: access is re-derived from a fresh assertion on each request (RFC 7523 §4), so it cannot outlive the enterprise IdP's policy/deprovisioning window.
    • RFC 8707 resource indicator → access-token aud (via Attesto.Token.mint/3's :audience option, requiring attesto ~> 0.8): a single valid resource becomes the minted aud (§2.2); an absent resource falls back to config.audience. The resource is authorized fail-closed (§2.2) — it must be config.audience or an explicitly configured jwt_bearer: [allowed_resources: [...]] entry — so an authenticated client cannot mint a token audienced to a resource the server does not serve. An invalid (non-absolute-URI / fragment / bad percent-encoding), multiple, or unauthorized resource is rejected invalid_target (§2.1).
    • See the ID-JAG guide. Requires attesto ~> 0.8.

Changed

  • Made OAuth error-code resolution (RFC 6749 §5.2) total by construction. The @error_* codes in the token core, token controller, introspection controller, and sender-constraint module are now compile-time atoms passed straight to OAuthError.new/3, replacing a private String.to_existing_atom/1 round-trip that could raise ArgumentError and turn a clean §5.2 error body into a 500 if a code string were ever emitted before its atom existed.

Documentation

  • Documented and test-proved the DCR → client_credentials subject seam. Dynamic Client Registration (RFC 7591 §3.2.1) issues an unprefixed client_id, while a minted principal's sub MUST carry its Attesto.PrincipalKind sub_prefix (:invalid_sub otherwise). The host's :build_principal callback is the sole seam that reconciles the two by namespacing :sub; the :build_principal doc on AttestoPhoenix.Config and the AttestoPhoenix.PrincipalStore.build_principal/3 behaviour doc now state this mandate and cite the prefix as mint-time defense-in-depth. A new end-to-end test registers a confidential client_credentials client through the registration endpoint, issues a token with the bare DCR id, and verifies sub == prefix <> client_id and client_id == client_id, with a negative control proving a non-prefixing :build_principal is rejected as the RFC 6749 §5.2 invalid_request.

[0.9.5] - 2026-06-16

Fixed

  • Holder-of-key (DPoP) failures are now surfaced ahead of the client-auth error (FAPI2 ensure-holder-of-key-required). A token request redeeming a sender-constrained (DPoP-bound) authorization code WITHOUT a DPoP proof is a holder-of-key failure; FAPI2 expects it reported as invalid_request/invalid_grant/invalid_dpop_proof. When such a request ALSO lacked client authentication, the client-auth check masked it with invalid_client. The token endpoint now reads the code (via the store's non-consuming c:Attesto.CodeStore.get/1) and, when it is DPoP-bound and no proof is presented, returns invalid_request "DPoP proof required" — even before the client-auth failure. The code is NOT consumed, so a legitimate retry is unaffected. Only DPoP-bound codes are affected; a plain (e.g. OIDC) code still surfaces invalid_client. Requires attesto 0.7.2.

Added

  • AttestoPhoenix.Store.EctoCodeStore.get/1 — the non-consuming read (c:Attesto.CodeStore.get/1) for the Ecto-backed code store, a plain SELECT of the live (unconsumed) row.

[0.9.4] - 2026-06-14

Security

Adversarial-review hardening of the token, authorization, and revocation endpoints (all found by an internal multi-agent security review).

  • Public clients can no longer run confidential-only grants. The token endpoint gated grants only on the optional per-client :client_grant_types callback (unset ⇒ all grants allowed), so a public (none) client that proved possession of no credential could run client_credentials (RFC 6749 §4.4) or RFC 8693 token-exchange. The resolved client-auth method is now threaded into the request, and both grants reject the :none path with invalid_client, independent of any host policy.

  • The revocation endpoint now enforces TLS. RevocationController never called check_https, so under the default require_https: true a plain-HTTP POST /oauth/revoke carrying the client secret + refresh token was still processed — leaking both over cleartext. It now gates on TLS first, like every other credential-bearing endpoint.

  • DPoP proofs are replay-protected at the token endpoint (RFC 9449 §11.1). SenderConstraint.bind_dpop never wired :replay_check, so a captured token-endpoint proof's jti was never recorded and the proof was replayable within its acceptance window. The proof's jti is now recorded (via the same default Attesto.DPoP.ReplayCache the PAR endpoint uses).

  • The direct (non-PAR) authorization endpoint honors a signed dpop_jkt. It read dpop_jkt from the raw outer query, ignoring the signed request object — letting a front-channel attacker strip or substitute the code's DPoP key binding. It now reads the value off the verified request (Attesto.AuthorizationRequest.dpop_jkt, requires attesto 0.7.1), so a signed request object's value is authoritative. The PAR-resolved path continues to use the PAR-verified thumbprint stored at the top level (a pushed request object is re-merged at /authorize, which would otherwise drop it).

  • The dynamic client registration endpoint now enforces TLS. RegistrationController.create/2 returns a freshly minted plaintext client_secret and delete/2 reads a registration-access-token bearer credential; neither gated on TLS, so under the default require_https: true they served those credentials over cleartext. Both now refuse plain HTTP first, like every other credential-bearing endpoint. (Found by adversarial verification of the revocation fix — same class, uncovered sibling.)

  • The revocation endpoint equalizes client-auth timing. A lookup failure skipped verify_client_secret, leaving a timing oracle for client-id enumeration. It now runs a dummy verify against an :unknown_client sentinel so the unknown-client and wrong-secret paths match in observable timing, matching the shared AttestoPhoenix.ClientAuthentication core.

  • CIMD SSRF guard covers Teredo and ORCHIDv2. Added 2001:0000::/32 (Teredo) and 2001:20::/28 (ORCHIDv2) to the RFC 6890 special-use IPv6 table the fetcher screens against.

[0.9.3] - 2026-06-14

Security

  • Token exchange can no longer broaden scope (RFC 8693 §2.1). The token-exchange grant validated the requested scope only against the host's :authorize_scope policy, which is never handed the subject token — so the library could not, and did not, enforce that the issued token's scope stays within the subject token's. A client registered for a broad scope set could exchange a narrowly-scoped subject token for a broader one. The token endpoint now rejects (invalid_scope) any requested scope not present in the subject token's scope, before delegating to :authorize_scope — an exchange can only preserve or narrow scope. (:authorize_scope may still narrow further.)

  • The token endpoint now enforces grant_types_supported. Previously the only grant gate was the optional per-client :client_grant_types callback (unset ⇒ every grant allowed), while discovery advertised a hardcoded grant superset including token-exchange — so a host that didn't lock every client down had an advertised, working token-exchange grant it never opted into. The token endpoint now rejects (unsupported_grant_type) any grant_type outside the configured set, as a global backstop independent of per-client policy.

Changed

  • grant_types_supported is now driven by host config, not a hardcoded list. Both discovery documents (RFC 8414 and OpenID configuration) and the new token endpoint gate read AttestoPhoenix.Config.grant_types_supported/1, which defaults to every implemented grant (so existing deployments are unchanged) and is narrowed by configuring :grant_types_supported — dropping a grant (e.g. token-exchange) now disables it across discovery, the token endpoint, and dynamic registration at once, instead of only registration.

[0.9.2] - 2026-06-14

Fixed

  • A CIMD client no longer crashes a host :authorize_scope policy. A Client ID Metadata Document need not declare a scope member, so the metadata map attesto hands the host policy callbacks carried no scope key at all. A scope policy written for a registered client (reading client.scopes) raised KeyError on it, 500-ing the token endpoint for an otherwise valid CIMD authorization_code exchange (observed end-to-end against the ChatGPT MCP connector). host_client/1 now exposes the document's declared scopes — or an empty set when the document omits scope — under the atom :scopes key, so the callback reads an empty declared set instead of a missing key. The host still owns what an empty set grants (typically the resource owner's consent).

Added

  • AttestoPhoenix.ClientIdMetadata.scopes/1 — the public accessor for a CIMD document's declared scopes (its space-delimited RFC 7591 §2 scope member as a list; [] when absent), alongside the existing client_id/1, redirect_uris/1, and jwks/1 accessors.

[0.9.1] - 2026-06-14

Added

  • Boot-time discovery-document safety guard. AttestoPhoenix.Config.new/1 now validates, at config-build time (alongside the existing required-key checks), that the discovery documents it will serve are internally consistent — so a "silent discovery mismatch" (a document that omits a required endpoint or advertises one the router does not mount, served 200 with no error) can no longer ship. It raises ArgumentError with an actionable message for two classes of failure:
    • A required discovery endpoint that would be missing or non-absolute. The RFC 8414 §2 / OpenID Connect Discovery §3 endpoints the library derives — issuer, authorization_endpoint, token_endpoint, and jwks_uri — must each resolve to an absolute URL (scheme + host). The realistic trigger is an :issuer that is not an absolute https URL (e.g. "issuer.example"), which URI.merge/2 turns into host-less, unresolvable endpoint URLs; this is the same class of failure as the 0.9.1 regression where the RFC 8414 document silently omitted authorization_endpoint.
    • An :oauth_path_prefix vs explicit per-endpoint override mismatch. When a host declares a non-default :oauth_path_prefix (committing every OAuth endpoint to one mount tree) but then sets a per-endpoint override (:token_path and friends) that escapes that prefix, discovery would advertise that endpoint at a path the router — which mounts every OAuth endpoint under one shared prefix — does not serve. That provable divergence now fails fast. A per-endpoint override on the default prefix, or one that stays under the declared prefix, remains a supported feature.

Fixed

  • The RFC 8414 /.well-known/oauth-authorization-server document now advertises authorization_endpoint. It was omitted entirely: Attesto.Discovery derives only issuer/token_endpoint, and the controller's host-member list never supplied authorization_endpoint, so the OAuth metadata silently lacked a field RFC 8414 §2 requires for the authorization-code flow. An OAuth client that reads this document rather than OpenID Discovery (e.g. the ChatGPT MCP connector) therefore concluded the server "does not implement OAuth." It is now derived via authorize_endpoint_url/1 — the same path resolution as token_endpoint, so the two cannot diverge. (OpenID Discovery's /.well-known/openid-configuration already advertised it.)

[0.9.0] - 2026-06-14

Requires attesto ~> 0.7.0.

Added

  • Client ID Metadata Documents (CIMD, draft-ietf-oauth-client-id-metadata-document-01) — opt-in, default off. A client can identify itself with no prior registration by using an HTTPS URL as its client_id; the authorization server dereferences that URL to a JSON client metadata document and uses it as the client. Enable with client_id_metadata: [enabled: true, ...] in the config.

    • AttestoPhoenix.ClientIdMetadata.Fetcher (+ the default ...Fetcher.Req) — the SSRF-guarded outbound GET. It resolves the host, rejects any A/AAAA address that is special-use (RFC 6890: loopback, private, link-local, CGNAT, multicast, reserved, and every IPv6 form that embeds an IPv4 — IPv4-mapped, NAT64 64:ff9b::/96 and local-use 64:ff9b:1::/48, 6to4, IPv4-compatible — unwrapped and re-checked), pins the connection to a validated IP to close the DNS-rebinding window (TLS SNI/cert stay on the original hostname), refuses redirects, requires 200 + JSON, and caps the body at 5 KB. Requires the optional :req dependency, or a host-supplied :fetcher (e.g. a CIMD proxy service).
    • AttestoPhoenix.ClientIdMetadata.Cache (default Ecto, cluster-coherent; ETS opt-out) — respects RFC 9111 cache headers clamped to bounds, never caches errors/invalid documents, re-checks expiry on read. New table attesto_client_id_metadata (mix attesto_phoenix.gen.migration), swept by AttestoPhoenix.Store.Sweeper.
    • AttestoPhoenix.ClientIdMetadata.Resolver + integration: a CIMD client_id URL resolves via the document and is wired through the authorization, PAR, and token endpoints as a {:cimd, metadata} client — PKCE forced, treated as a public client (or private_key_jwt via the document jwks/jwks_uri), redirect_uri exact-matched against the document's redirect_uris and (by default) required to be same-origin with the client_id URL. Opaque client_ids still resolve through :load_client unchanged.
    • Discovery advertises client_id_metadata_document_supported when enabled.
  • New optional dependency {:req, "~> 0.5", optional: true} for the default CIMD fetcher (a host that never enables CIMD pays nothing).

[0.8.0] - 2026-06-14

Requires attesto ~> 0.6.16.

Added

  • AttestoPhoenix.Store.EctoPARStore — a Postgres-backed Pushed Authorization Request store (RFC 9126), closing the last per-node gap to a fully clusterable authorization server. PAR was the only mutable OAuth store without an Ecto implementation: the default AttestoPhoenix.Store.PAR.ETS keeps the request_uri → params mapping in per-node memory, so a reference pushed to one node could not be resolved when /authorize landed on another — and FAPI 2.0 requires PAR. The new store persists each pushed request so any node resolves a request_uri issued by any other, matching the code/refresh/nonce/replay Ecto stores. fetch/1 is non-consuming (the authorization endpoint may re-enter after a login/consent detour); take/1 is an atomic single-use DELETE … RETURNING.

  • Atomic single-use of the PAR request_uri at completion. The authorization endpoint now claims the pushed reference with the store's atomic take/1 before issuing the code (it was previously consumed after issuance, with the result ignored), so two concurrent completions — on one node or across a cluster — can no longer each mint a code from one pushed request: exactly one wins the claim; the loser is redirected invalid_request_uri and issues nothing. Resolution still uses the non-consuming fetch/1, so a host may establish login/consent and re-enter /authorize with the same reference.

Changed

  • README documents the clustering story end-to-end and the PAR caveat; the :par_store config doc points at EctoPARStore for clustered/FAPI deployments. The default par_store is unchanged (single-node ETS), so existing single-node hosts are unaffected.

[0.7.7] - 2026-06-13

Requires attesto ~> 0.6.16.

Fixed

  • Token endpoint finalizes the authorization code only after the full response is built. The authorization_code grant now calls Attesto.AuthorizationCode.finalize/3 (new in attesto 0.6.16) once the access token, optional refresh token, and id_token have all been minted and recorded successfully. Previously the reuse marker was set the moment the code validated, so any later failure in the same request (a refresh-store write error, an id_token mint fault, a host build_principal callback returning the subject under the wrong key) left the code spent AND flagged as a successful redemption — turning a legitimate client retry into a false reuse attack that revoked the whole refresh-token family. A redemption that validates but fails downstream is now a clean invalid_grant on replay.

[0.7.6] - 2026-06-12

Requires attesto ~> 0.6.13.

Fixed

  • The token endpoint no longer short-circuits a missing PKCE code_verifier as invalid_request. PKCE enforcement is challenge-based: Token.fetch_code_verifier/3 passes the verifier through to Attesto.AuthorizationCode.redeem/4, which requires a matching verifier for a challenge-bound code and collapses a missing OR mismatched verifier to a single invalid_grant (RFC 7636 §4.6). The authorization/PAR endpoint still requires a code_challenge for clients that must use PKCE (RequestPolicy.require_pkce?/2), so a challenge-bound code is always issued. Matches the FAPI ensure-pkce-code-verifier-required test (it expects invalid_grant).

[0.7.5] - 2026-06-10

Requires attesto ~> 0.6.13.

Security

  • PAR request_uri is now single-use (RFC 9126 §2.2 / FAPI 2.0). The reference is consumed once an authorization code is issued (not on the non-consuming fetch that lets the host establish login/consent and re-enter), so a completed flow cannot be replayed within the remaining TTL. An already-consumed reference is rejected as invalid_request_uri. (Flips the conformance PARAttemptReuseRequestUri warning to a clean pass.)
  • UserInfo derives the DPoP htu via RequestContext.canonical_url, like every other endpoint — honouring a configured :htu but otherwise gating X-Forwarded-*/Host on the trusted-proxy allowlist. Previously it fell back to the raw request Host when :htu was unset (its default), the one endpoint that bypassed the host-header trust boundary.

Fixed

  • Sender-constrained (DPoP/mTLS) clients now require PKCE. A FAPI 2.0 client is sender-constrained, and FAPI 2.0 Security Profile §5.3.1.2 / RFC 9700 §2.1.1 mandate PKCE for it even though it authenticates confidentially (e.g. private_key_jwt). RequestPolicy.require_pkce?/2 now forces PKCE whenever client_requires_dpop?/client_requires_mtls? is true, regardless of the global :require_pkce flag, and the token endpoint enforces the matching code_verifier through that same predicate (one source of truth, so the authorization and token endpoints cannot drift). A plain confidential Basic-profile client still follows the global flag. (Flips the conformance EnsurePKCERequired test to a pass.)

[0.7.4] - 2026-06-04

Requires attesto ~> 0.6.13.

Security / FAPI 2.0 conformance

Closes four conformance gaps found by auditing the OpenID FAPI 2.0 test suite source against the implementation:

  • PAR request_uri is bound to the client. The authorization endpoint now rejects a front-channel client_id that does not match the client the request_uri was issued to (RFC 9126 §2.2 / PAREnsureRequestUriIsBoundToClient) instead of silently using the stored client.
  • Unknown/expired PAR request_uri → invalid_request_uri. A urn:ietf:params:oauth:request_uri: reference not in the store now returns the correct invalid_request_uri error rather than falling through to request_uri_not_supported/invalid_request (RFC 9126 §2.2 / PARAttemptToUseExpiredRequestUri). External (non-PAR) references still report request_uri_not_supported.
  • PAR rejects a request_uri parameter. The PAR endpoint rejects a request carrying request_uri (RFC 9126 §2.1 step 2), checked on the raw parameters so it cannot be masked by a request object replacing the set.
  • Client-assertion audience is issuer-only. private_key_jwt assertions at the token, PAR, and introspection endpoints must be audienced to the issuer identifier (FAPI 2.0 §5.3.2.1); the concrete endpoint URL is no longer accepted as aud, closing a confused-deputy gap (PAREndpointAsAudienceFails).

Changed

  • :authorization_response_iss now defaults to true (RFC 9207 authorization-server mix-up defense, mandated by FAPI 2.0). Set false to opt out. Discovery advertises authorization_response_iss_parameter_supported accordingly.
  • Internal: mix dialyzer is clean again. token.ex resolves :principal_kinds by reading the struct field directly (its type admits a list, unlike the callback() | nil reader), and two fail-closed grant-pipeline clauses are documented in .dialyzer_ignore.exs. No behaviour change.

[0.7.3] - 2026-06-04

The FAPI 2.0 Message Signing endpoints on the Phoenix layer: signed authorization responses (JARM), the RFC 7662 / RFC 9701 introspection endpoint, and PAR/JAR hardening. Requires attesto ~> 0.6.13.

Added

  • POST /oauth/introspect — OAuth 2.0 Token Introspection (RFC 7662) with the RFC 9701 signed-JWT response (FAPI 2.0 Message Signing §5.5). Authenticates the caller through the shared AttestoPhoenix.ClientAuthentication core (client_secret_basic/client_secret_post/private_key_jwt), introspects via the conn-free Attesto.Introspection, and negotiates by Accept between the plain JSON response and application/token-introspection+jwt.
  • :introspection_authorize Config callback (caller_client_id, response -> boolean) — authorizes the authenticated introspection caller against the token (RFC 7662 §4 / RFC 9701 §5). Consulted only for an active response; a non-true return (or a raise) downgrades the response to %{"active" => false} so a caller not entitled to the token learns nothing about it. Optional — when unset, every authenticated caller may introspect any token (the single-trust-domain default).
  • The authorization endpoint emits JARM (§5.4) responses for the JARM response_modes (jwt/query.jwt/fragment.jwt/form_post.jwt), and the discovery documents advertise the supported response_modes_supported, authorization_signing_alg_values_supported, the introspection endpoint, and its signing-algorithm metadata.

Changed

  • The PAR endpoint now validates the pushed request as an authorization request at push time (RFC 9126 §2.1 step 3): the request redirect_uri must exactly match one of the client's registered URIs (RFC 6749 §3.1.2.3), and the response_type/PKCE/response_mode must be valid, so an invalid request is refused early rather than only when the request_uri is later resolved at /authorize. The redirect-URI/PKCE/nonce policy is resolved by the new conn-free AttestoPhoenix.AuthorizationServer.RequestPolicy, shared with the authorization endpoint so both validate identically. A host that mounts the PAR endpoint must configure :client_redirect_uris (the authorization endpoint already required it).
  • AttestoPhoenix.ClientAuthentication.Result.client_id falls back to the presented credential identifier so the signed-introspection audience (and the PAR/token client identity) resolves without a separate :client_id callback.
  • OpenID Provider Metadata derives request_parameter_supported (and only then advertises request_object_signing_alg_values_supported) from actual request-object capability — whether the host can resolve a client's trusted JWKS (a :client_jwks callback or an installed :client_store). An install without that capability now advertises request_parameter_supported: false instead of a JAR support it cannot honour.
  • The OAuth 2.0 Authorization Server Metadata document (RFC 8414) now advertises the signed-request-object metadata (require_signed_request_object and request_object_signing_alg_values_supported, RFC 9101 §10.5), matching the OpenID Provider Metadata document so a FAPI client reading either sees identical JAR support. Both documents derive it from the new conn-free AttestoPhoenix.AuthorizationServer.RequestObjectMetadata (no more split, drift-prone assembly).
  • AttestoPhoenix.Config now rejects at boot a :request_object_policy that requires a signed request object (e.g. Policy.fapi_message_signing/0) when no :client_jwks capability is configured. Such a config is unsatisfiable (every authorization request would be rejected) and would otherwise advertise the incoherent pair request_parameter_supported: false + require_signed_request_object: true. Pair the policy with :client_jwks (or an installed :client_store).

[0.7.2] - 2026-06-03

Added

  • :request_object_policy Config key (an Attesto.RequestObject.Policy, default %Policy{} = generic OpenID Connect §6.1). It is enforced at BOTH the PAR endpoint and /authorize: a signed request object pushed to /par is verified there (rejected with invalid_request_object if it fails the policy), and re-verified at /authorize (RFC 9101). On success the PAR store holds the VERIFIED request-object parameters, never the unsigned body values beside them (RFC 9101 §6.3). A non-%Attesto.RequestObject.Policy{} value is rejected at boot. Set Attesto.RequestObject.Policy.fapi_message_signing() for the FAPI 2.0 Message Signing §5.3.1 profile (nbf/exp required and bounded to 60 minutes, typ = "oauth-authz-req+jwt"). Behaviour is unchanged unless a host opts in. Requires attesto ~> 0.6.12.

[0.7.1] - 2026-06-03

Added

  • :client_auth_signing_algs Config key — the JOSE algorithms accepted for private_key_jwt client-assertion signatures, threaded into Attesto.ClientAssertion.verify/5 (via its :accepted_algs opt) and also rendered as token_endpoint_auth_signing_alg_values_supported in discovery. Defaults to Attesto.SigningAlg.fapi_algs/0 (PS256, ES256, EdDSA), so behaviour is unchanged unless a host overrides it. Verification and the advertised metadata now read this one value and cannot drift. Requires attesto ~> 0.6.11.

[0.7.0] - 2026-06-03

A structural refactor of the token/PAR controllers into a reusable authorization-server core, plus a behaviour-module install surface and several correctness fixes. Pre-1.0 minor bump because it carries breaking changes to the host-callback contract (see BREAKING below).

Added

  • Behaviour-module install for host callbacks. The Config keys :client_store, :principal_store, :consent_policy, :scope_policy, :event_sink, :registration, and :claims_provider each resolve their callbacks from a single installed module. Precedence is fixed: an explicit flat callback key wins; else the installed behaviour module if it exports the callback; else nil. The required capabilities (load_client, verify_client_secret, load_principal) are validated by resolution at boot, so a behaviour-module-only install works. Boot-time conformance validation fails fast on a typo'd or partial module.
  • AttestoPhoenix.ClaimsProvider behaviour — the host UserInfo/ID-Token claim source (build_userinfo_claims/3, build_id_token_claims/4).
  • AttestoPhoenix.Callback — one callback dispatcher (function / {m,f} / {m,f,extra}), replacing ~10 duplicated private invoke/2 helpers.
  • AttestoPhoenix.ClientAuthentication and AttestoPhoenix.AuthorizationServer.{SenderConstraint, Token, PAR} — conn-free core modules. The token and PAR controllers are now thin adapters that lift conn facts into data, call the core, and render; the core returns data and audit events rather than writing the conn or emitting events.

Changed

  • BREAKING: the ID-Token extra-claims source is now the separate :build_id_token_claims callback ((client, subject, granted_scopes, requested_claims -> map), and it MUST NOT carry sub). Previously the 4-arity form of :build_userinfo_claims doubled as the ID-Token source; :build_userinfo_claims is now the 3-arity UserInfo source only. Hosts that wired a 4-arity :build_userinfo_claims must move it to :build_id_token_claims.
  • BREAKING: AttestoPhoenix.ClaimsProvider no longer declares build_principal/3; principal building stays solely on AttestoPhoenix.PrincipalStore. Claim sourcing and principal loading are separate concerns.
  • Client-assertion aud now accepts the issuer or the concrete token/PAR endpoint URL (RFC 7523 / OIDC Core §9), widened from issuer-only. The endpoint URL is derived from trusted Config (issuer + path), never the request Host. Still FAPI 2 valid (the issuer remains accepted).
  • Client authentication (RFC 6749 §2.3.1): a request-body client_id presented alongside HTTP Basic is accepted as identification when it matches the Basic userid, and rejected as invalid_request when it conflicts. Only a second credential (body client_secret or client_assertion) is treated as a competing authentication method. The token and PAR endpoints now share one client-authentication implementation, so they no longer diverge.
  • PAR stores the resolved authenticated client_id; when no :client_id callback is configured it leaves the request's presented client_id intact rather than clobbering it. The opaque-struct client[:id]/client["id"] fallback is removed.

[0.6.23] - 2026-06-02

Changed

  • Require the client-authentication assertion aud to be the issuer identifier at both the token and PAR endpoints (FAPI 2). The endpoint URL is no longer accepted as an audience. Requires attesto ~> 0.6.10.

[0.6.22] - 2026-06-02

Changed

  • Advertise only the FAPI 2 client-authentication signing algorithms (PS256, ES256, EdDSA) in token_endpoint_auth_signing_alg_values_supported, matching the underlying enforcement in attesto 0.6.9 which rejects RS256 client assertions. Requires attesto ~> 0.6.9.

[0.6.21] - 2026-06-02

Fixed

  • Return the standard OAuth token endpoint error invalid_request when a client that requires DPoP omits the proof entirely. Presented-but-invalid proofs still return invalid_dpop_proof; the omitted-proof case now matches FAPI's expected token endpoint error classification.

[0.6.20] - 2026-06-02

Added

  • Add :refresh_token_rotation_grace_seconds to AttestoPhoenix.Config and pass it through to Attesto.RefreshToken.rotate/3. The default is now a FAPI retry-compatible 60-second idempotency window for retrying a just-rotated refresh token when the client did not receive or persist the first rotation response; set 0 for strict immediate reuse revocation.

[0.6.19] - 2026-06-02

Fixed

  • Bind refresh tokens to the DPoP proof key only for public clients, as required by RFC 9449. Confidential clients keep refresh tokens bound to the authenticated client, allowing a later refresh request to use a fresh DPoP proof key while still minting the returned access token as DPoP-bound to that current proof.

[0.6.18] - 2026-06-02

Added

  • Add :client_requires_dpop? as a host callback so deployments can mark a client as requiring DPoP-bound token issuance. When such a client calls the token endpoint without a DPoP proof, the controller now rejects the request with invalid_dpop_proof rather than silently issuing an unbound Bearer token.

[0.6.17] - 2026-06-02

Fixed

  • Treat a resolved PAR request_uri as the complete authorization request, so front-channel parameters outside the pushed request object do not augment the request. In particular, a state query parameter that was not included in the pushed request is no longer echoed in the authorization response.

[0.6.16] - 2026-06-02

Fixed

  • Allow PAR requests to carry an explicit dpop_jkt without also requiring a DPoP proof on the PAR request itself. If a PAR DPoP proof is present, an explicit dpop_jkt must still match that proof; otherwise the stored thumbprint is later enforced when the authorization code is redeemed.

[0.6.15] - 2026-06-02

Fixed

  • Carry the DPoP JWK thumbprint from a pushed authorization request into the issued authorization code. A token request that redeems the code with a different DPoP proof key is now rejected instead of minting a token bound to the later key.

[0.6.14] - 2026-06-01

Fixed

  • Verify DPoP proofs at the PAR endpoint and bind stored pushed authorization requests to the verified proof key. If a PAR request includes an explicit dpop_jkt, it must match the verified proof JWK thumbprint; mismatches now return invalid_dpop_proof instead of issuing a request_uri.

[0.6.13] - 2026-06-01

Fixed

  • Accept private_key_jwt client assertions whose aud is the issuer at the token endpoint and PAR endpoint, while continuing to accept endpoint-specific audiences and reject unrelated audiences. This matches FAPI conformance suite client-authentication behavior without relaxing signature, iss/sub, jti, or replay checks.

[0.6.12] - 2026-06-01

Security

  • Reject replayed private_key_jwt client assertions at the token endpoint and PAR endpoint by recording assertion jti values through the configured replay check.
  • Enforce per-client registered grant types when a host provides :client_grant_types, preventing a client registered for one grant from minting tokens through another.
  • Bind PAR request_uri authorization requests to the authenticated pushed request client and store that authenticated client id, rather than trusting a front-channel or body-supplied client_id.

Fixed

  • Preserve keystore-provided per-key alg metadata in the JWKS endpoint. This keeps FAPI deployments that sign ID tokens with PS256 from advertising the same key as RS256.
  • Add the zero-arity issue/0 entrypoint to the Ecto DPoP nonce store so server-issued DPoP nonces work when the store is configured directly as a behaviour module.
  • Decode form-encoded client id and secret values in revocation endpoint Basic authentication, matching the token endpoint.
  • Make the default ETS PAR store tolerate concurrent first-use table creation.

[0.6.11] - 2026-06-01

Fixed

  • Resolve PAR request_uri references non-destructively at the authorization endpoint, so host login or consent re-entry can complete without consuming the pushed request before authorization-code issuance.

Changed

  • Add a fetch callback to AttestoPhoenix.PARStore for authorization-endpoint resolution. Existing custom stores that only implement take/1 still work through a compatibility fallback, but new stores should implement fetch/1.

[0.6.10] - 2026-06-01

Fixed

  • Treat an explicit nil :par_store config value as unset when applying the default ETS PAR store. This prevents PAR from calling nil.put/3 when hosts enable pushed authorization requests without overriding the development PAR store.
  • Apply the same nil-aware defaulting to authorization-endpoint PAR resolution.

[0.6.9] - 2026-06-01

Added

  • Advertise FAPI-required discovery metadata when configured: authorization_response_iss_parameter_supported: true when RFC 9207 authorization-response iss is enabled, and token_endpoint_auth_signing_alg_values_supported from Attesto's asymmetric signing algorithm set for private_key_jwt clients.

[0.6.8] - 2026-06-01

Added

  • Add host-configurable FAPI-oriented authorization-server controls: :require_pushed_authorization_requests rejects direct front-channel authorization requests unless they arrive through a PAR request_uri, and :authorization_response_iss includes the RFC 9207 iss parameter on successful and error authorization responses.
  • Allow hosts to configure the advertised and accepted token endpoint client authentication methods. The token endpoint and PAR endpoint now enforce :token_endpoint_auth_methods_supported when set, so deployments can expose stricter profiles such as private_key_jwt only.
  • Advertise configured token endpoint authentication methods and PAR-required policy in OAuth/OIDC metadata.

[0.6.7] - 2026-06-01

Added

  • Mount POST /oauth/authorize alongside GET /oauth/authorize, matching OpenID Connect Core's requirement that the Authorization Endpoint support both methods.
  • Extend the Ecto authorization-code store with successful-consumption markers and issued-access-token tracking. When a successfully redeemed authorization code is replayed, the token endpoint still returns invalid_grant and now revokes the access token minted by the original code redemption when the Ecto store is configured.

[0.6.6] - 2026-06-01

Fixed

  • Dynamic client registration now preserves inline jwks metadata (RFC 7591 §2) and hands it to the host :register_client callback. Hosts can then return those keys through :client_jwks for request-object and private_key_jwt verification.

[0.6.5] - 2026-06-01

Fixed

  • Return a clean request_uri_not_supported authorization response for unsupported OIDC request_uri references when no PAR store is configured, instead of calling a nil PAR store.

[0.6.4] - 2026-05-31

Changed

  • Replace the direct jason dependency with Elixir's built-in JSON module.

Added

  • Add a test-only req_dpop compatibility check proving that AttestoPhoenix.Plug.Authenticate accepts RFC 9449 DPoP proofs generated by an external Req client plugin. req_dpop is not a runtime dependency.
  • Document req_dpop as an optional Req client companion for tests and internal tooling.

[0.6.3] - 2026-05-31

Added

  • mix attesto_phoenix.install, an upgrade-aware Igniter installer. It is idempotent and re-runnable: it adds the AttestoPhoenix.Config config skeleton (issuer, keystore, repo, the Ecto-backed token stores, a chosen :oauth_path_prefix, and neutral defaults) to the host config, mounts attesto_routes/1 at the chosen prefix into the host router, scaffolds host callback modules implementing the recommended behaviours (ClientStore, PrincipalStore, ScopePolicy, ConsentPolicy, RegistrationStore, EventSink) with documented stub callbacks, and points the host at mix attesto_phoenix.gen.migration for the Ecto tables. igniter is declared as an optional dependency, so the runtime package never forces it on consumers; the task is available to a host that opts into running it. Options: --oauth-path-prefix and --callbacks-module.

  • Configurable OAuth endpoint paths. AttestoPhoenix.Config now accepts an :oauth_path_prefix (default "/oauth", reproducing the historic surface) plus explicit per-endpoint overrides (:authorize_path, :token_path, :par_path, :revocation_path, :registration_path, :userinfo_path) that win when set. Resolver helpers (token_endpoint_url/1, par_endpoint_url/1, revocation_endpoint_url/1, registration_endpoint_url/1, userinfo_endpoint_url/1, authorize_endpoint_url/1, jwks_uri/1, registration_client_uri/2, and the *_path/1 helpers) build absolute URLs from the issuer and the resolved path. The discovery (RFC 8414), OpenID-configuration (OpenID Connect Discovery), and registration (RFC 7591 / RFC 7592) controllers read every advertised URL from these resolvers instead of hardcoding /oauth/*, and to_attesto_config/2 passes the resolved token path to the core builder automatically so the DPoP htu follows the mount. A host that mounts under /mcp/oauth now advertises correct URLs.

  • Named host-contract behaviours documenting the full callback contract with the governing RFC for each callback, as the recommended production shape: AttestoPhoenix.ClientStore, AttestoPhoenix.PrincipalStore, AttestoPhoenix.ScopePolicy, AttestoPhoenix.ConsentPolicy, AttestoPhoenix.RegistrationStore, and AttestoPhoenix.EventSink. Wiring is unchanged: pass an anonymous function, a {module, function} pair, or a {module, function, extra_args} triple per AttestoPhoenix.Config key.

  • Dynamic registration metadata passthrough (RFC 7591 §2). The registration endpoint now validates and carries the known client-identity members (client_name, client_uri, logo_uri, contacts, policy_uri, tos_uri, and related software/JWKS members) through to :register_client so consent screens keep the client's identity. Unknown members are dropped and never promoted to trusted policy; known members are merged under the validated protocol-critical members so they cannot override them.

  • Actionable AttestoPhoenix.Config.new/1 validation errors that name the callback/store/path to add for each enabled feature, and absolute-path validation for :oauth_path_prefix and the per-endpoint overrides.

  • Operations guides wired into the published docs: replay_nonce_production.md, proxy_canonical_host.md, error_envelope.md, consumer_migration.md, and examples.md.

[0.6.2]

  • Advertise response_modes_supported: ["query"] from the RFC 8414 OAuth Authorization Server Metadata endpoint, matching the authorization-code redirect response mode already used by the Phoenix authorization endpoint.

[0.6.1]

  • Emit :token_denied audit/telemetry events for token endpoint failures, including OAuth error, status, client/grant/scope context when available, and sender-constraint presence.
  • Normalize Phoenix callback specs before handing :cert_der to core Attesto protected-resource verification, so function captures, {Module, function}, and {Module, function, extra_args} all work consistently.

[0.6.0]

Initial release: a Phoenix/Ecto OAuth 2.0 / OIDC authorization server layer over attesto.

Added

  • AttestoPhoenix.Config: centralized, validated configuration with neutral host callbacks (:load_client, :verify_client_secret, :load_principal, :authorize_scope, :on_event, and others), deriving the Attesto.Config the protocol layer consumes.
  • AttestoPhoenix.Router: the attesto_routes/1 macro mounting the token, revocation, discovery, JWKS, and optional dynamic-registration endpoints.
  • Controllers for the token endpoint (authorization_code, refresh_token, and client_credentials grants), revocation (RFC 7009), discovery (RFC 8414), JWKS (RFC 7517), and optional dynamic client registration (RFC 7591).
  • AttestoPhoenix.Plug.Authenticate and AttestoPhoenix.Plug.RequireScopes protected-resource plugs with DPoP and mTLS sender-constraint enforcement.
  • Ecto-backed implementations of the attesto store behaviours: code store, refresh store (rotation with reuse detection), DPoP nonce store, and DPoP jti replay check, plus an optional TTL sweeper.
  • mix attesto_phoenix.gen.migration to generate the operational tables.
  • Pushed Authorization Requests (PAR, RFC 9126), private_key_jwt client authentication, signed request object validation, token exchange, UserInfo, registration management cleanup, and Phoenix resource-server plugs.