зеркало из https://github.com/Azure/AzureRMR.git
preemptive fixing for v2 token
This commit is contained in:
Родитель
a7b0f71bda
Коммит
42f672905a
|
@ -68,7 +68,12 @@ public=list(
|
|||
{
|
||||
self$host <- if(token$version == 1)
|
||||
token$resource
|
||||
else token$scope
|
||||
else
|
||||
{
|
||||
scope <- httr::parse_url(token$scope[1])
|
||||
scope$path <- NULL
|
||||
httr::build_url(scope)
|
||||
}
|
||||
self$tenant <- token$tenant
|
||||
self$token <- token
|
||||
return(NULL)
|
||||
|
@ -81,6 +86,7 @@ public=list(
|
|||
if(!is.null(conf$app)) app <- conf$app
|
||||
if(!is.null(conf$auth_type)) auth_type <- conf$auth_type
|
||||
if(!is.null(conf$password)) password <- conf$password
|
||||
if(!is.null(conf$username)) username <- conf$username
|
||||
if(!is.null(conf$host)) host <- conf$host
|
||||
if(!is.null(conf$aad_host)) aad_host <- conf$aad_host
|
||||
}
|
||||
|
|
|
@ -60,9 +60,9 @@ process_headers <- function(token, ..., auto_refresh)
|
|||
token$refresh()
|
||||
}
|
||||
|
||||
host <- httr::parse_url(if(token$version == 1) token$resource else token$scope[1])$hostname
|
||||
creds <- token$credentials
|
||||
host <- httr::parse_url(creds$resource)$host
|
||||
headers <- c(Host=host, Authorization=paste(creds$token_type, creds$access_token))
|
||||
headers <- c(Authorization=paste(creds$token_type, creds$access_token))
|
||||
|
||||
# default content-type is json, set this if encoding not specified
|
||||
dots <- list(...)
|
||||
|
|
Загрузка…
Ссылка в новой задаче