adk_auth_provider behaviour (erlang_adk v0.7.0)

View Source

Behaviour implemented by authentication token providers.

Provider implementations receive credentials only inside a short-lived, supervised refresh worker. Implementations must not log credentials, token responses, or provider errors before redaction.

Summary

Types

context/0

-type context() :: map().

credential/0

-type credential() :: map().

error_reason/0

-type error_reason() :: term().

token/0

-type token() :: #{access_token := binary(), expires_in_ms := pos_integer(), token_type => binary()}.

Callbacks

refresh/2

-callback refresh(Credential :: credential(), Context :: context()) ->
                     {ok, token()} | {error, error_reason()}.