Wise.Services.OAuth (Wise v1.0.0)

Copy Markdown View Source

Wise OAuth 2.0 token exchange and refresh.

Summary

Functions

authorization_url(config, client_id, redirect_uri, opts \\ [])

@spec authorization_url(Wise.Config.t(), String.t(), String.t(), keyword()) ::
  String.t()

Generates the OAuth authorization URL.

exchange_code(config, client_id, client_secret, code, redirect_uri)

@spec exchange_code(Wise.Config.t(), String.t(), String.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, Wise.Error.t()}

Exchanges an authorization code for tokens.

exchange_registration_code(config, client_id, client_secret, reg_code)

@spec exchange_registration_code(Wise.Config.t(), String.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, Wise.Error.t()}

Exchanges a registration code for tokens.

refresh_token(config, client_id, client_secret, refresh_token)

@spec refresh_token(Wise.Config.t(), String.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, Wise.Error.t()}

Refreshes an access token.