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 AccessTokenResponse =
response.AccessTokenResponse
pub type AuthorizationSetter =
token_request.AuthorizationSetter
pub type ClientAuthentication =
authentication.ClientAuthentication
pub type ClientId =
common.ClientId
pub type RequestError =
token_request.RequestError
pub type RequestModifier =
fn(request.Request(List(#(String, String)))) -> Result(
request.Request(List(#(String, String))),
token_request.RequestError,
)
pub type ResponseError =
response.ResponseError
pub type Secret =
common.Secret
pub type TokenRequest =
token_request.TokenRequest
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 parse_token_response: fn(response.Response(String)) -> Result(
response.AccessTokenResponse,
response.ResponseError,
)
pub const secret_is_valid: fn(common.Secret) -> Bool
pub const to_http_request: fn(token_request.TokenRequest) -> Result(
request.Request(String),
token_request.RequestError,
)
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