From ca8a464d23d55afd32571475db223e065ffd8a52 Mon Sep 17 00:00:00 2001 From: Nikolay Turpitko Date: Wed, 11 Mar 2015 13:23:10 +0600 Subject: [PATCH] oauth2: new endpoints Added *.Endpoint constants for facebook, linkedin, odnoklassniki, paypal and vk. Related to issue #41. Change-Id: Ib447ff773a540aa9bc932a0e18d9bb9ef8703f87 Reviewed-on: https://go-review.googlesource.com/7370 Reviewed-by: Burcu Dogan --- facebook/facebook.go | 16 ++++++++++++++++ linkedin/linkedin.go | 16 ++++++++++++++++ odnoklassniki/odnoklassniki.go | 16 ++++++++++++++++ paypal/paypal.go | 22 ++++++++++++++++++++++ vk/vk.go | 16 ++++++++++++++++ 5 files changed, 86 insertions(+) create mode 100644 facebook/facebook.go create mode 100644 linkedin/linkedin.go create mode 100644 odnoklassniki/odnoklassniki.go create mode 100644 paypal/paypal.go create mode 100644 vk/vk.go diff --git a/facebook/facebook.go b/facebook/facebook.go new file mode 100644 index 00000000..962e86b0 --- /dev/null +++ b/facebook/facebook.go @@ -0,0 +1,16 @@ +// Copyright 2015 The oauth2 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 facebook provides constants for using OAuth2 to access Facebook. +package facebook // import "golang.org/x/oauth2/facebook" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is Facebook's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://www.facebook.com/dialog/oauth", + TokenURL: "https://graph.facebook.com/oauth/access_token", +} diff --git a/linkedin/linkedin.go b/linkedin/linkedin.go new file mode 100644 index 00000000..de91d5b9 --- /dev/null +++ b/linkedin/linkedin.go @@ -0,0 +1,16 @@ +// Copyright 2015 The oauth2 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 linkedin provides constants for using OAuth2 to access LinkedIn. +package linkedin // import "golang.org/x/oauth2/linkedin" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is LinkedIn's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://www.linkedin.com/uas/oauth2/authorization", + TokenURL: "https://www.linkedin.com/uas/oauth2/accessToken", +} diff --git a/odnoklassniki/odnoklassniki.go b/odnoklassniki/odnoklassniki.go new file mode 100644 index 00000000..2f7a9621 --- /dev/null +++ b/odnoklassniki/odnoklassniki.go @@ -0,0 +1,16 @@ +// Copyright 2015 The oauth2 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 odnoklassniki provides constants for using OAuth2 to access Odnoklassniki. +package odnoklassniki // import "golang.org/x/oauth2/odnoklassniki" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is Odnoklassniki's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://www.odnoklassniki.ru/oauth/authorize", + TokenURL: "https://api.odnoklassniki.ru/oauth/token.do", +} diff --git a/paypal/paypal.go b/paypal/paypal.go new file mode 100644 index 00000000..baeaa237 --- /dev/null +++ b/paypal/paypal.go @@ -0,0 +1,22 @@ +// Copyright 2015 The oauth2 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 paypal provides constants for using OAuth2 to access PayPal. +package paypal // import "golang.org/x/oauth2/paypal" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is PayPal's OAuth 2.0 endpoint in live (production) environment. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize", + TokenURL: "https://api.paypal.com/v1/identity/openidconnect/tokenservice", +} + +// SandboxEndpoint is PayPal's OAuth 2.0 endpoint in sandbox (testing) environment. +var SandboxEndpoint = oauth2.Endpoint{ + AuthURL: "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize", + TokenURL: "https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice", +} diff --git a/vk/vk.go b/vk/vk.go new file mode 100644 index 00000000..5acdeb18 --- /dev/null +++ b/vk/vk.go @@ -0,0 +1,16 @@ +// Copyright 2015 The oauth2 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 vk provides constants for using OAuth2 to access VK.com. +package vk // import "golang.org/x/oauth2/vk" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is VK's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://oauth.vk.com/authorize", + TokenURL: "https://oauth.vk.com/access_token", +}