Lockspire.Host.TokenExchangeValidator behaviour (lockspire v1.0.0)

Copy Markdown

Behaviour for validating token exchange requests against host application business logic.

Summary

Callbacks

Validates a token exchange request.

Callbacks

validate(context)

@callback validate(context :: Lockspire.Host.TokenExchangeContext.t()) ::
  :ok | {:ok, %{claims: map()}} | {:error, term()}

Validates a token exchange request.

Returns:

  • :ok to permit the exchange with default claims.
  • {:ok, %{claims: claims}} to permit and merge additional claims.
  • {:error, reason} to deny the exchange.