Boruta.Oauth.Introspect (Boruta core v1.2.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
Specs
token(
request :: %Boruta.Oauth.IntrospectRequest{
client_id: String.t(),
client_secret: String.t(),
token: String.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{...}}