From 3f139277bf2fce2836edb9b6718018cddd7b9b6e Mon Sep 17 00:00:00 2001 From: Hong Ooi Date: Thu, 24 Oct 2019 10:22:24 +0800 Subject: [PATCH] tweak auth code --- R/call_azure_rm.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/call_azure_rm.R b/R/call_azure_rm.R index d51ca77..73a2bd6 100644 --- a/R/call_azure_rm.R +++ b/R/call_azure_rm.R @@ -70,11 +70,11 @@ process_headers <- function(token, auto_refresh) token$refresh() } - creds <- token$credentials - host <- httr::parse_url(AzureAuth::decode_jwt(creds$access_token)$payload$aud)$hostname + access_token <- extract_jwt(token) + host <- httr::parse_url(decode_jwt(access_token)$payload$aud)$hostname headers <- c( Host=host, - Authorization=paste(creds$token_type, creds$access_token), + Authorization=paste("Bearer", access_token), `Content-Type`="application/json" )