summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Candino <enrico.candino@gmail.com>2024-04-05 14:39:27 +0000
committerMatt Hickford <matt.hickford@gmail.com>2024-04-05 22:25:10 +0000
commite11eea88a89331c1fae3d38a37f484363a8d597d (patch)
treef46adfb1e55fa8c483c3a1734bfe83390ad350e6
parentd0e617c58cf747cf27df9762003502f814dd524c (diff)
downloadgolang-x-oauth2-e11eea88a89331c1fae3d38a37f484363a8d597d.tar.gz
microsoft: added DeviceAuthURL to AzureADEndpoint
The Microsoft identity platform supports the device authorization grant: https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-device-code This PR adds the "https://login.microsoftonline.com/{tenant}/oauth2/v2.0/devicecode" DeviceAuthURL to the AzureADEndpoint. Fixes golang/oauth2#700 Change-Id: I8ca571391e0e0f4d383e3f2f07a66b26edcb4679 GitHub-Last-Rev: 2b953c3d57c3a03b68e1c118c7663d84c8f71116 GitHub-Pull-Request: golang/oauth2#701 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/564315 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Matt Hickford <matt.hickford@gmail.com> Run-TryBot: Matt Hickford <matt.hickford@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
-rw-r--r--endpoints/endpoints.go9
-rw-r--r--microsoft/microsoft.go5
2 files changed, 8 insertions, 6 deletions
diff --git a/endpoints/endpoints.go b/endpoints/endpoints.go
index 7fb3314..89ed30f 100644
--- a/endpoints/endpoints.go
+++ b/endpoints/endpoints.go
@@ -68,8 +68,8 @@ var GitLab = oauth2.Endpoint{
// Google is the endpoint for Google.
var Google = oauth2.Endpoint{
- AuthURL: "https://accounts.google.com/o/oauth2/auth",
- TokenURL: "https://oauth2.googleapis.com/token",
+ AuthURL: "https://accounts.google.com/o/oauth2/auth",
+ TokenURL: "https://oauth2.googleapis.com/token",
DeviceAuthURL: "https://oauth2.googleapis.com/device/code",
}
@@ -227,8 +227,9 @@ func AzureAD(tenant string) oauth2.Endpoint {
tenant = "common"
}
return oauth2.Endpoint{
- AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
- TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",
+ AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
+ TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",
+ DeviceAuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/devicecode",
}
}
diff --git a/microsoft/microsoft.go b/microsoft/microsoft.go
index 3ffbc57..13091d6 100644
--- a/microsoft/microsoft.go
+++ b/microsoft/microsoft.go
@@ -25,7 +25,8 @@ func AzureADEndpoint(tenant string) oauth2.Endpoint {
tenant = "common"
}
return oauth2.Endpoint{
- AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
- TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",
+ AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
+ TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",
+ DeviceAuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/devicecode",
}
}