livery_auth_oidc (livery v0.2.0)
View SourceOIDC provider discovery.
discover/1,2 fetches an issuer's
/.well-known/openid-configuration document and returns it as a
decoded map (notably jwks_uri, issuer, authorization_endpoint,
token_endpoint). Feed the jwks_uri to livery_auth_jwks:keys/1
to get verification keys.
The HTTP fetch is pluggable via fetch => fun((Url) -> {ok, Body} | {error, _}); the default uses livery_auth_jwks:default_fetch/1
(hackney).
{ok, Cfg} = livery_auth_oidc:discover(<<"https://issuer.example">>),
JwksUri = maps:get(<<"jwks_uri">>, Cfg),
{ok, Keys} = livery_auth_jwks:keys(JwksUri).
Summary
Functions
Fetch and parse the OIDC discovery document for an issuer.
Build the discovery URL for an issuer (handles a trailing slash).
Types
Functions
Fetch and parse the OIDC discovery document for an issuer.
Build the discovery URL for an issuer (handles a trailing slash).