ExOauth2Provider v0.5.2 ExOauth2Provider.Token.ClientCredentials View Source

Functions for dealing with client credentials 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, config \\ []) View Source
grant(map(), keyword()) :: {:ok, map()} | {:error, map(), atom()}

Will grant access token by client credentials.

Example

ExOauth2Provider.Token.grant(%{
  "grant_type" => "client_credentials",
  "client_id" => "Jf5rM8hQBc",
  "client_secret" => "secret"
}, otp_app: :my_app)

Response

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