Skip to content

Commit b52af7d

Browse files
committed
endpoints: add GitLab DeviceAuthURL
See GitLab documentation https://docs.gitlab.com/ee/api/oauth2.html#device-authorization-grant-flow. Change-Id: Ideffbfcb67e0b25251a0b18148e57eab43124d37 GitHub-Last-Rev: 6ecd45e GitHub-Pull-Request: golang#733 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/600095 TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Matt Hickford <[email protected]> Reviewed-by: Matt Hickford <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Reviewed-by: David Chase <[email protected]> TryBot-Bypass: Matt Hickford <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 6d8340f commit b52af7d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

endpoints/endpoints.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ var GitHub = oauth2.Endpoint{
6262

6363
// GitLab is the endpoint for GitLab.
6464
var GitLab = oauth2.Endpoint{
65-
AuthURL: "https://gitlab.com/oauth/authorize",
66-
TokenURL: "https://gitlab.com/oauth/token",
65+
AuthURL: "https://gitlab.com/oauth/authorize",
66+
TokenURL: "https://gitlab.com/oauth/token",
67+
DeviceAuthURL: "https://gitlab.com/oauth/authorize_device",
6768
}
6869

6970
// Google is the endpoint for Google.

gitlab/gitlab.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
package gitlab // import "golang.org/x/oauth2/gitlab"
77

88
import (
9-
"golang.org/x/oauth2"
9+
"golang.org/x/oauth2/endpoints"
1010
)
1111

1212
// Endpoint is GitLab's OAuth 2.0 endpoint.
13-
var Endpoint = oauth2.Endpoint{
14-
AuthURL: "https://gitlab.com/oauth/authorize",
15-
TokenURL: "https://gitlab.com/oauth/token",
16-
}
13+
var Endpoint = endpoints.GitLab

0 commit comments

Comments
 (0)