View Source Boruta.Oauth.Introspect (Boruta core v2.3.3)

Access token introspection

Summary

Functions

Returns corresponding token for the given Boruta.Oauth.IntrospectRequest

Functions

Link to this function

token(introspect_request)

View Source
@spec token(request :: Boruta.Oauth.IntrospectRequest.t()) ::
  {:ok, token :: Boruta.Oauth.Token.t()}
  | {:error, error :: Boruta.Oauth.Error.t()}

Returns corresponding token for the given Boruta.Oauth.IntrospectRequest

Note : Invalid tokens returns an error {:error, %Error{error: :invalid_access_token, ...}}. That must be rescued to return %{"active" => false} in application implementation.

Examples

iex> token(%IntrospectRequest{
  client_id: "client_id",
  client_secret: "client_secret",
  token: "token"
})
{:ok, %Token{...}}