View Source Boruta.Oauth.Authorization.Client (Boruta core v2.3.3)

Check against given params and return the corresponding client

Summary

Functions

Authorize the client corresponding to the given params.

Functions

@spec authorize(
  [id: String.t(), source: map(), grant_type: String.t()]
  | [
      id: String.t(),
      source: map() | nil,
      redirect_uri: String.t(),
      grant_type: String.t()
    ]
  | [
      id: String.t(),
      source: map() | nil,
      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,
       state: term(),
       status: :unauthorized
     }}

Authorize the client corresponding to the given params.

Examples

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