Boruta.Oauth.Authorization.Client (Boruta core v1.2.0) View Source

Client authorization

Link to this section Summary

Functions

Authorize the client corresponding to the given params.

Link to this section Functions

Specs

authorize(
  [id: String.t(), secret: String.t()]
  | [id: String.t(), secret: String.t(), grant_type: String.t()]
  | [id: String.t(), redirect_uri: String.t(), grant_type: String.t()]
  | [
      id: String.t(),
      redirect_uri: String.t(),
      grant_type: String.t(),
      code_verifier: String.t()
    ]
) ::
  {:ok, Boruta.Oauth.Client.t()}
  | {:error,
     %Boruta.Oauth.Error{
       error: :invalid_client,
       error_description: String.t(),
       format: nil,
       redirect_uri: nil,
       status: :unauthorized
     }}

Authorize the client corresponding to the given params.

Examples

iex> authorize(id: "id", secret: "secret")
{:ok, %Boruta.Oauth.Client{...}}