View Source Zoth.Token.Password (Zoth v1.0.1)

Functions for dealing with refresh token strategy.

Link to this section Summary

Functions

Will grant access token by password authentication.

Link to this section Functions

Link to this function

grant(request, config \\ [])

View Source
@spec grant(
  map(),
  keyword()
) :: {:ok, map()} | {:error, map(), atom()}

Will grant access token by password authentication.

example

Example

Zoth.Token.grant(%{
  "grant_type" => "password",
  "client_id" => "Jf5rM8hQBc",
  "client_secret" => "secret",
  "username" => "testuser@example.com",
  "password" => "secret"
}, otp_app: :my_app)

response

Response

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