req_oauth_client_credentials {httr2} | R Documentation |
This uses oauth_flow_client_credentials()
to generate an access token,
which is then used to authentication the request with req_auth_bearer_token()
.
The token is cached in memory.
req_oauth_client_credentials(req, client, scope = NULL, token_params = list())
req |
A request. |
client |
An |
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")
req <- request("https://example.com")
req %>% req_oauth_client_credentials(client)