# `ExSaml.AuthorizationCodeCache`
[🔗](https://github.com/docJerem/ex_saml/blob/main/lib/ex_saml/caches/authorization_code_cache.ex#L1)

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.

# `get`

Retrieves the authorization code data for the given key.

# `put`

Stores authorization code data with the default TTL.

# `put_new!`

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

# `take`

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

# `ttl`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
