req_oauth_bearer_jwt {httr2} | R Documentation |
This uses oauth_flow_bearer_jwt()
to generate an access token which is then
used to authenticate the request with req_auth_bearer_token()
.
The token is cached in memory.
req_oauth_bearer_jwt(
req,
client,
claim,
signature = "jwt_encode_sig",
signature_params = list(),
scope = NULL,
token_params = list()
)
req |
A request. |
client |
An |
claim |
A list of claims. If all elements of the claim set are static
apart from |
signature |
Function use to sign |
signature_params |
Additional arguments passed to |
scope |
Scopes to be requested from the resource owner. |
token_params |
List containing additional parameters passed to the
|
A modified HTTP request.
client <- oauth_client("example", "https://example.com/get_token")
claim <- jwt_claim()
req <- request("https://example.com")
req %>% req_oauth_bearer_jwt(client, claim)