flwr_oauth2/bearer_token
This module aims to fulfill most of RFC6750 for attaching an access token to an HTTP request to a protected resource.
Values
pub fn attach_access_token_to_body(
req: request.Request(List(#(String, String))),
token: flwr_oauth2.AccessTokenResponse,
) -> request.Request(List(#(String, String)))
Attach the access token to the body as access token.
This function adds the access token to the body of provided request.
It does not set the content type to application/x-www-form-urlencoded, but in order to send the body with the access token to a server it has to be set and the body needs to be url encoded.
See RFC6750.
pub fn attach_access_token_to_query_parameters(
req: request.Request(a),
token: flwr_oauth2.AccessTokenResponse,
) -> request.Request(a)
Attach the access token to the query parameters as access token. See RFC6750.
pub fn attach_bearer_token_header(
req: request.Request(a),
token: flwr_oauth2.AccessTokenResponse,
) -> request.Request(a)
Attach the access token to the Authorization header as Bearer token.
See RFC6750.