req_auth <- function(req) {
req_oauth_password(req,
client = oauth_client("example", "https://example.com/get_token"),
username = "username"
)
}
if (interactive()) {
request("https://example.com") |>
req_auth()
}
Run the code above in your browser using DataLab