func (provider *GoogleProvider) GetUser(creds *common.Credentials) (common.User, error) {
	profileData, err := provider.Get(creds, googleEndpointProfile)
	if err != nil {
		return nil, err
	}
	user := NewUser(profileData, creds, provider)
	return user, nil
}
GetUser uses the specified common.Credentials to access the users profile
from the remote provider, and builds the appropriate User object.
package google
import (
	"github.com/stretchr/gomniauth"
	"github.com/stretchr/gomniauth/common"
	"github.com/stretchr/gomniauth/oauth2"
	"github.com/stretchr/objx"
	"net/http"
)
const (
	googleDefaultScope    string = "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
	googleName            string = "google"
	googleDisplayName     string = "Google"
	googleAuthURL         string = "https://accounts.google.com/o/oauth2/auth"
	googleTokenURL        string = "https://accounts.google.com/o/oauth2/token"
	googleEndpointProfile string = "https://www.googleapis.com/oauth2/v1/userinfo"
)
type GoogleProvider struct {
	config         *common.Config
	tripperFactory common.TripperFactory
}
func New(clientId, clientSecret, redirectUrl string) *GoogleProvider {
	p := new(GoogleProvider)
	p.config = &common.Config{Map: objx.MSI(
		oauth2.OAuth2KeyAuthURL, googleAuthURL,
		oauth2.OAuth2KeyTokenURL, googleTokenURL,
		oauth2.OAuth2KeyClientID, clientId,
		oauth2.OAuth2KeySecret, clientSecret,
		oauth2.OAuth2KeyRedirectUrl, redirectUrl,
		oauth2.OAuth2KeyScope, googleDefaultScope,
		oauth2.OAuth2KeyAccessType, oauth2.OAuth2AccessTypeOnline,
		oauth2.OAuth2KeyApprovalPrompt, oauth2.OAuth2ApprovalPromptAuto,
		oauth2.OAuth2KeyResponseType, oauth2.OAuth2KeyCode)}
	return p
}
func (provider *GoogleProvider) TripperFactory() common.TripperFactory {
	if provider.tripperFactory == nil {
		provider.tripperFactory = new(oauth2.OAuth2TripperFactory)
	}
	return provider.tripperFactory
}
func (provider *GoogleProvider) PublicData(options map[string]interface{}) (interface{}, error) {
	return gomniauth.ProviderPublicData(provider, options)
}
func (provider *GoogleProvider) Name() string {
	return googleName
}
func (provider *GoogleProvider) DisplayName() string {
	return googleDisplayName
}
func (provider *GoogleProvider) GetBeginAuthURL(state *common.State, options objx.Map) (string, error) {
	if options != nil {
		scope := oauth2.MergeScopes(options.Get(oauth2.OAuth2KeyScope).Str(), googleDefaultScope)
		provider.config.Set(oauth2.OAuth2KeyScope, scope)
	}
	return oauth2.GetBeginAuthURLWithBase(provider.config.Get(oauth2.OAuth2KeyAuthURL).Str(), state, provider.config)
}
func (provider *GoogleProvider) Get(creds *common.Credentials, endpoint string) (objx.Map, error) {
	return oauth2.Get(provider, creds, endpoint)
}