ExOauth2Provider v0.2.3 ExOauth2Provider.Token.AuthorizationCode View Source

Functions for dealing with authorization code strategy.

Link to this section Summary

Functions

Will grant access token by client credentials

Link to this section Functions

Link to this function grant(request) View Source
grant(Map.t()) :: {:ok, Map.t()} | {:error, Map.t(), atom()}

Will grant access token by client credentials.

Example

ExOauth2Provider.Token.grant(%{
  "code" => "1jf6a",
  "client_id" => "Jf5rM8hQBc",
  "client_secret" => "secret",
  "redirect_uri" => "https://example.com/",
  "grant_type" => "authorization_code"
})

Response

{:ok, access_token}
{:error, %{error: error, error_description: description}, http_status}