зеркало из https://github.com/Azure/AzureGraph.git
preemptive fixing for v2 token
This commit is contained in:
Родитель
c85da4adc6
Коммит
c8479ac035
|
@ -57,8 +57,8 @@ 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))
|
||||
|
||||
# default content-type is json, set this if encoding not specified
|
||||
|
|
|
@ -81,7 +81,12 @@ public=list(
|
|||
{
|
||||
self$host <- if(token$version == 1)
|
||||
token$resource
|
||||
else token$scope
|
||||
else
|
||||
{
|
||||
scope <- httr::parse_url(token[1])
|
||||
scope$path <- NULL
|
||||
httr::build_url(scope)
|
||||
}
|
||||
self$tenant <- token$tenant
|
||||
self$token <- token
|
||||
return(NULL)
|
||||
|
@ -94,6 +99,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$graph_host)) host <- conf$graph_host
|
||||
if(!is.null(conf$aad_host)) aad_host <- conf$aad_host
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче