View Source Oidcc.TokenIntrospection (Oidcc v3.0.0-alpha.2)
OAuth Token Introspection
Link to this section Summary
Functions
Introspect the given access token
Link to this section Types
@type t() :: %Oidcc.TokenIntrospection{ active: boolean(), client_id: binary(), exp: pos_integer(), scope: :oidcc_scope.scopes(), username: binary() }
Link to this section Functions
@spec introspect( token :: String.t() | Oidcc.Token.t(), client_context :: Oidcc.ClientContext.t(), opts :: :oidcc_token_introspection.opts() ) :: {:ok, t()} | {:error, :oidcc_token_introspection.error()}
Introspect the given access token
For a high level interface using Oidcc.ProviderConfiguration.Worker
see Oidcc.introspect_token/5
.
examples
Examples
iex> {:ok, pid} =
...> Oidcc.ProviderConfiguration.Worker.start_link(%{
...> issuer: "https://login.yahoo.com"
...> })
...>
...> {:ok, client_context} =
...> Oidcc.ClientContext.from_configuration_worker(
...> pid,
...> "client_id",
...> "client_secret"
...> )
...>
...> Oidcc.TokenIntrospection.introspect(
...> "access_token",
...> client_context
...> )
...> # => {:ok, %Oidcc.TokenIntrospection{}}