Skip to content

Commit e11eea8

Browse files
enrichmanhickford
authored andcommitted
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#700 Change-Id: I8ca571391e0e0f4d383e3f2f07a66b26edcb4679 GitHub-Last-Rev: 2b953c3 GitHub-Pull-Request: golang#701 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/564315 Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Matt Hickford <[email protected]> Run-TryBot: Matt Hickford <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Than McIntosh <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent d0e617c commit e11eea8

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

endpoints/endpoints.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ var GitLab = oauth2.Endpoint{
6868

6969
// Google is the endpoint for Google.
7070
var Google = oauth2.Endpoint{
71-
AuthURL: "https://accounts.google.com/o/oauth2/auth",
72-
TokenURL: "https://oauth2.googleapis.com/token",
71+
AuthURL: "https://accounts.google.com/o/oauth2/auth",
72+
TokenURL: "https://oauth2.googleapis.com/token",
7373
DeviceAuthURL: "https://oauth2.googleapis.com/device/code",
7474
}
7575

@@ -227,8 +227,9 @@ func AzureAD(tenant string) oauth2.Endpoint {
227227
tenant = "common"
228228
}
229229
return oauth2.Endpoint{
230-
AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
231-
TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",
230+
AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
231+
TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",
232+
DeviceAuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/devicecode",
232233
}
233234
}
234235

microsoft/microsoft.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ func AzureADEndpoint(tenant string) oauth2.Endpoint {
2525
tenant = "common"
2626
}
2727
return oauth2.Endpoint{
28-
AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
29-
TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",
28+
AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
29+
TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",
30+
DeviceAuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/devicecode",
3031
}
3132
}

0 commit comments

Comments
 (0)