AttestoPhoenix.AuthorizationServer.Revocation (AttestoPhoenix v5.0.0)

Copy Markdown View Source

OAuth 2.0 Token Revocation (RFC 7009), as conn-free core.

Validates the required "token" parameter, revokes the refresh token and its descendant family bound to the authenticated client_id via Attesto.Revocation, and returns the :token_revoked audit event as data.

Only refresh tokens are revocable. A presented access token is handled like an unknown token and stays valid until it expires, and access tokens already issued from a revoked refresh family are not invalidated. See AttestoPhoenix.Controller.RevocationController for the reasoning.

Summary

Functions

Extract the required "token" parameter from params.

Revoke token (bound to client_id) in store and return {:ok, [event]}.

Functions

fetch_token(params)

@spec fetch_token(map()) :: {:ok, String.t()} | {:error, :invalid_request}

Extract the required "token" parameter from params.

revoke(config, client_id, token, token_type_hint \\ nil, opts \\ [])

@spec revoke(
  AttestoPhoenix.Config.t(),
  String.t() | nil,
  String.t(),
  String.t() | nil,
  keyword()
) ::
  {:ok, [AttestoPhoenix.Event.t()]}

Revoke token (bound to client_id) in store and return {:ok, [event]}.