From ef147856a6ddbb60760db74283d2424e98c87bff Mon Sep 17 00:00:00 2001 From: Manigandan Dharmalingam Date: Wed, 20 Jun 2018 17:47:24 +0000 Subject: [PATCH] stackoverflow: add stackoverflow oauth2 endpoints. Fixes #297 Stackoverflow oauth2 endpoints constant added. Ref: https://api.stackexchange.com/docs/authentication Change-Id: I8285a9baa9514c79e8325c40434f62aa1ed4939b GitHub-Last-Rev: 909997b81e544c02130cc08f5fc1cea65872a7a0 GitHub-Pull-Request: golang/oauth2#298 Reviewed-on: https://go-review.googlesource.com/119995 Reviewed-by: Brad Fitzpatrick --- internal/token.go | 1 + stackoverflow/stackoverflow.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 stackoverflow/stackoverflow.go diff --git a/internal/token.go b/internal/token.go index 3954c9b..999e668 100644 --- a/internal/token.go +++ b/internal/token.go @@ -129,6 +129,7 @@ var brokenAuthHeaderProviders = []string{ "https://log.finalsurge.com/oauth/token", "https://multisport.todaysplan.com.au/rest/oauth/access_token", "https://whats.todaysplan.com.au/rest/oauth/access_token", + "https://stackoverflow.com/oauth/access_token", } // brokenAuthHeaderDomains lists broken providers that issue dynamic endpoints. diff --git a/stackoverflow/stackoverflow.go b/stackoverflow/stackoverflow.go new file mode 100644 index 0000000..82711f7 --- /dev/null +++ b/stackoverflow/stackoverflow.go @@ -0,0 +1,16 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package stackoverflow provides constants for using OAuth2 to access Stack Overflow. +package stackoverflow // import "golang.org/x/oauth2/stackoverflow" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is Stack Overflow's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://stackoverflow.com/oauth", + TokenURL: "https://stackoverflow.com/oauth/access_token", +}