ExOauth2Provider v0.5.0 ExOauth2Provider.Token View Source
Handler for dealing with generating access tokens.
Link to this section Summary
Functions
Grants an access token based on grant_type strategy.
Revokes an access token as per http://tools.ietf.org/html/rfc7009
Link to this section Functions
Link to this function
grant(request, config \\ [])
View Source
grant(request, config \\ [])
View Source
grant(map(), keyword()) :: {:ok, Ecto.Schema.t()} | {:error, map(), term()}
grant(map(), keyword()) :: {:ok, Ecto.Schema.t()} | {:error, map(), term()}
Grants an access token based on grant_type strategy.
Example
ExOauth2Provider.Token.authorize(resource_owner, %{
"grant_type" => "invalid",
"client_id" => "Jf5rM8hQBc",
"client_secret" => "secret"
})
Response
{:error, %{error: error, error_description: description}, http_status}
Link to this function
revoke(request, config \\ [])
View Source
revoke(request, config \\ [])
View Source
revoke(map(), keyword()) :: {:ok, Ecto.Schema.t()} | {:error, map(), term()}
revoke(map(), keyword()) :: {:ok, Ecto.Schema.t()} | {:error, map(), term()}
Revokes an access token as per http://tools.ietf.org/html/rfc7009
Example
ExOauth2Provider.Token.revoke(resource_owner, %{
"client_id" => "Jf5rM8hQBc",
"client_secret" => "secret",
"token" => "fi3S9u"
})
Response
{:ok, %{}}