From 5cb5c904ab3fbedde40f7923c60846e7b7b3db61 Mon Sep 17 00:00:00 2001 From: samkaplan Date: Mon, 19 Aug 2024 14:46:05 -0500 Subject: [PATCH] updat to match EntraID docs --- Project.toml | 2 +- src/AzSessions.jl | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 8d7846b..23c9470 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "AzSessions" uuid = "f239b30d-ae6b-58be-a2d5-7e9f30e280a9" -version = "2.1.6" +version = "2.1.7" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/src/AzSessions.jl b/src/AzSessions.jl index 823706a..3d4fc6c 100644 --- a/src/AzSessions.jl +++ b/src/AzSessions.jl @@ -230,11 +230,12 @@ end function token(session::AzClientCredentialsSession; offset=Second(rand(300:600))) session.token != "" && now(Dates.UTC) < (session.expiry - offset) && return session.token + scope = "$(rstrip(session.resource, '/'))/.default" r = @retry 10 HTTP.request( "POST", "https://login.microsoft.com/$(session.tenant)/oauth2/token", ["Content-Type" => "application/x-www-form-urlencoded"], - "grant_type=client_credentials&client_id=$(session.client_id)&client_secret=$(HTTP.escapeuri(session.client_secret))&resource=$(HTTP.escapeuri(session.resource))", + "grant_type=client_credentials&client_id=$(session.client_id)&client_secret=$(HTTP.escapeuri(session.client_secret))&scope=$(HTTP.escapeuri(scope))", retry = false) rbody = JSON.parse(String(r.body))