Ueberauth.Strategy.Authify.JWKSCache (Ueberauth Authify v0.1.0)

View Source

A process-free cache for organization JWKS documents.

Signing keys are cached per JWKS URI in a public ETS table so that repeated logins do not refetch the key set on every callback. The cache is refreshed whenever an ID token references a kid that is missing from the cached keys (rotated signing keys) or a signature check fails against them.

Summary

Functions

Empties the cache. Intended for tests.

Returns the signing keys for jwks_uri, fetching (and caching) them when not already cached or when force: true is passed.

Functions

clear()

@spec clear() :: :ok

Empties the cache. Intended for tests.

fetch(jwks_uri, opts \\ [])

@spec fetch(
  binary(),
  keyword()
) :: {:ok, [map()]} | {:error, binary()}

Returns the signing keys for jwks_uri, fetching (and caching) them when not already cached or when force: true is passed.