nova_auth_oidc_client_credentials (nova_auth_oidc v0.1.3)

View Source

Client credentials flow for machine-to-machine authentication. Obtains and caches access tokens using the OAuth2 client credentials grant.

Usage

{ok, AccessToken} = nova_auth_oidc_client_credentials:get_token(my_oidc_config, authentik),
%% Use AccessToken to call another service

Summary

Functions

Get a (possibly cached) M2M access token for the given provider.

Get a M2M access token with specific scopes.

Force refresh the cached M2M token.

Functions

get_token(AuthMod, Provider)

-spec get_token(module(), atom()) -> {ok, binary()} | {error, term()}.

Get a (possibly cached) M2M access token for the given provider.

get_token(AuthMod, Provider, Scopes)

-spec get_token(module(), atom(), [binary()]) -> {ok, binary()} | {error, term()}.

Get a M2M access token with specific scopes.

refresh(AuthMod, Provider)

-spec refresh(module(), atom()) -> {ok, binary()} | {error, term()}.

Force refresh the cached M2M token.