1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-01-08 04:03:53 +02:00

Merge branch 'master' into add-facebook-provider

Conflicts:
	oauth2/oauth2_test.go
This commit is contained in:
orian 2015-08-03 22:39:57 +02:00
commit b63d1351f4
2 changed files with 3 additions and 7 deletions

View File

@ -13,6 +13,7 @@ import (
"golang.org/x/net/context" "golang.org/x/net/context"
"golang.org/x/oauth2" "golang.org/x/oauth2"
"golang.org/x/oauth2/facebook" "golang.org/x/oauth2/facebook"
"golang.org/x/oauth2/google"
"gopkg.in/authboss.v0" "gopkg.in/authboss.v0"
"gopkg.in/authboss.v0/internal/mocks" "gopkg.in/authboss.v0/internal/mocks"
) )
@ -23,7 +24,7 @@ var testProviders = map[string]authboss.OAuth2Provider{
ClientID: `jazz`, ClientID: `jazz`,
ClientSecret: `hands`, ClientSecret: `hands`,
Scopes: []string{`profile`, `email`}, Scopes: []string{`profile`, `email`},
Endpoint: GoogleEndpoint, Endpoint: google.Endpoint,
}, },
Callback: Google, Callback: Google,
AdditionalParams: url.Values{"include_requested_scopes": []string{"true"}}, AdditionalParams: url.Values{"include_requested_scopes": []string{"true"}},
@ -110,7 +111,7 @@ func TestOAuth2Init(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
if !strings.Contains(loc, GoogleEndpoint.AuthURL) { if !strings.Contains(loc, google.Endpoint.AuthURL) {
t.Error("Redirected to wrong url:", loc) t.Error("Redirected to wrong url:", loc)
} }

View File

@ -9,11 +9,6 @@ import (
) )
var ( var (
// GoogleEndpoint can be used to
GoogleEndpoint = oauth2.Endpoint{
AuthURL: `https://accounts.google.com/o/oauth2/auth`,
TokenURL: `https://accounts.google.com/o/oauth2/token`,
}
googleInfoEndpoint = `https://www.googleapis.com/userinfo/v2/me` googleInfoEndpoint = `https://www.googleapis.com/userinfo/v2/me`
) )