TamaOAuth.TokenRequest (tama_oauth v0.1.0)

Copy Markdown View Source

Parses bounded authorization-code and refresh-token requests.

This module validates transport-neutral fields. Applications still load and atomically consume the corresponding persisted credential.

Summary

Types

authentication_method()

@type authentication_method() :: :none | :private_key_jwt

t()

@type t() :: %TamaOAuth.TokenRequest{
  authentication_method: authentication_method(),
  client_id: String.t(),
  grant_type: :authorization_code | :refresh_token,
  params: map()
}

Functions

detect_authentication(params, authorization_headers)

@spec detect_authentication(map(), list()) ::
  {:ok, authentication_method()} | {:error, TamaOAuth.Error.t()}

parse(params, opts \\ [])

@spec parse(
  map(),
  keyword()
) :: {:ok, t()} | {:error, TamaOAuth.Error.t()}