flwr_oauth2

This module implements functions and types for RFC6749. It offers types for all the major OAuth 2.0 grant types and functions to create the correct HTTP requests for those grant types. Furthermore, it offers functions to generate redirect URIs for the Authorization Code Grant Type and the Implicit Grant Type.

It also supports RFC7636, which adds the Proof Key for Code Exchange to the Authorization Code Grant.

Types

pub type ClientId =
  common.ClientId
pub type RequestModifier =
  fn(request.Request(List(#(String, String)))) -> Result(
    request.Request(List(#(String, String))),
    token_request.RequestError,
  )
pub type Scope =
  List(String)
pub type Secret =
  common.Secret
pub type UrlEncRequest =
  request.Request(List(#(String, String)))

Values

pub const is_secret_invalid: fn(common.Secret) -> Bool
pub const parse_scope: fn(String) -> List(String)
pub const secret_is_valid: fn(common.Secret) -> Bool
pub const to_http_request_with_custom_authentication: fn(
  token_request.TokenRequest,
  List(
    fn(request.Request(List(#(String, String)))) -> Result(
      request.Request(List(#(String, String))),
      token_request.RequestError,
    ),
  ),
) -> Result(request.Request(String), token_request.RequestError)
pub const to_http_request_with_modifiers: fn(
  token_request.TokenRequest,
  List(
    fn(request.Request(List(#(String, String)))) -> Result(
      request.Request(List(#(String, String))),
      token_request.RequestError,
    ),
  ),
) -> Result(request.Request(String), token_request.RequestError)
pub const to_string_client_authentication: fn(
  authentication.ClientAuthentication,
) -> String
pub const to_string_token_request: fn(token_request.TokenRequest) -> String
pub const to_string_token_response: fn(
  response.AccessTokenResponse,
) -> String
Search Document