Boruta.Oauth.Introspect (Boruta core v2.0.0-rc.1) View Source

OAuth Introspect

Link to this section Summary

Functions

Returns corresponding token for the given Boruta.Oauth.IntrospectRequest

Link to this section Functions

Link to this function

token(introspect_request)

View Source

Specs

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{...}}