View Source Boruta.Oauth.Authorization.Code (Boruta core v3.0.0-beta.2)

Check against given params and return the corresponding code

Summary

Functions

Authorize the code corresponding to the given params.

Functions

@spec authorize(
  %{
    value: String.t(),
    client: Boruta.Oauth.Client.t(),
    code_verifier: String.t(),
    redirect_uri: String.t()
  }
  | %{value: String.t()}
) ::
  {:error,
   %Boruta.Oauth.Error{
     error: :invalid_code,
     error_description: String.t(),
     format: nil,
     redirect_uri: nil,
     state: term(),
     status: :bad_request
   }}
  | {:ok, Boruta.Oauth.Token.t()}

Authorize the code corresponding to the given params.

Examples

iex> authorize(value: "value", redirect_uri: "redirect_uri")
{:ok, %Boruta.Oauth.Token{...}}