зеркало из https://github.com/Azure/AzureRMR.git
move authtype check into token code
This commit is contained in:
Родитель
2335b1c476
Коммит
f794977fc5
|
@ -92,8 +92,9 @@ private=list(
|
|||
|
||||
|
||||
#' @export
|
||||
get_azure_token=function(aad_host, tenant, app, auth_type, secret, arm_host)
|
||||
get_azure_token=function(aad_host, tenant, app, auth_type=c("client credentials", "device code"), secret, arm_host)
|
||||
{
|
||||
auth_type <- match.arg(auth_type)
|
||||
base_url <- file.path(aad_host, tenant, fsep="/")
|
||||
if(auth_type == "client credentials")
|
||||
auth_with_creds(base_url, app, secret, arm_host)
|
||||
|
|
|
@ -9,7 +9,7 @@ public=list(
|
|||
token=NULL,
|
||||
|
||||
# authenticate and get subscriptions
|
||||
initialize=function(tenant, app, auth_type=c("client credentials", "device code"), secret,
|
||||
initialize=function(tenant, app, auth_type="client credentials", secret,
|
||||
host="https://management.azure.com/", aad_host="https://login.microsoftonline.com/",
|
||||
config_file=NULL)
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ public=list(
|
|||
|
||||
self$host <- host
|
||||
self$tenant <- tenant
|
||||
self$token <- get_azure_token(aad_host, tenant, app, match.arg(auth_type), secret, host)
|
||||
self$token <- get_azure_token(aad_host, tenant, app, auth_type, secret, host)
|
||||
NULL
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче