ExSaml.AuthorizationCodeCache (ex_saml v1.0.2)

Copy Markdown View Source

TTL-based authorization code cache.

Stores authorization codes during the SAML authentication flow with a 30-second TTL. Uses the cache module configured via config :ex_saml, cache: MyApp.Cache.

The take/1 function atomically retrieves and deletes the code, ensuring single-use consumption.

Summary

Functions

Retrieves the authorization code data for the given key.

Stores authorization code data with the default TTL.

Stores only if the key doesn't already exist. Returns :ok or {:error, :already_exists}.

Atomically retrieves and deletes the authorization code (single-use).

Returns the default TTL for authorization codes (30 seconds).

Functions

get(key)

Retrieves the authorization code data for the given key.

put(key, value, opts \\ [])

Stores authorization code data with the default TTL.

put_new!(key, value, opts \\ [])

Stores only if the key doesn't already exist. Returns :ok or {:error, :already_exists}.

take(key)

Atomically retrieves and deletes the authorization code (single-use).

ttl()

Returns the default TTL for authorization codes (30 seconds).