if (FALSE) {
# Create an authentication function
auth_fn <- get_credential_auth(
scope = "https://graph.microsoft.com/.default"
)
# Call it to get headers
auth_headers <- auth_fn()
# Use with httr2
req <- httr2::request("https://graph.microsoft.com/v1.0/me") |>
httr2::req_headers(!!!auth_headers)
}
Run the code above in your browser using DataLab