adk_authorization_code_adapter behaviour (erlang_adk v0.7.0)

View Source

Internal adapter contract for an OAuth/OIDC authorization-code flow.

Implementations receive only operator-owned context and manager-generated flow bindings. Browser callers can never select an adapter or inject transport options.

Summary

Types

authorization_opts/0

-type authorization_opts() ::
          #{state := binary(),
            nonce := binary(),
            pkce_verifier := binary(),
            redirect_uri := binary(),
            scopes := [binary()],
            resource := undefined | binary()}.

context/0

-type context() :: map().

exchange_opts/0

-type exchange_opts() ::
          #{state := binary(),
            nonce := binary(),
            pkce_verifier := binary(),
            redirect_uri := binary(),
            scopes := [binary()],
            resource := undefined | binary()}.

Callbacks

authorization_uri/2

-callback authorization_uri(context(), authorization_opts()) -> {ok, iodata()} | {error, term()}.

exchange_code/3

-callback exchange_code(context(), binary(), exchange_opts()) ->
                           {ok, adk_credential_store:credential()} | {error, term()}.

validate_context/1

-callback validate_context(context()) -> ok | {error, term()}.