Exemplo n.º 1
0
func (a *App) client() *oauth2.Client {
	if a.Client == nil {
		a.Client = oauth2.New(Authorization, Exchange)
		a.Client.DecodeError = decodeError
	}
	return a.Client
}
Exemplo n.º 2
0
func (a *App) client() *oauth2.Client {
	if a.Client == nil {
		a.Client = oauth2.New(authorizationURL, tokenURL)
		a.Client.DecodeError = googleError
		a.Client.AuthorizationParameters = map[string]string{
			"response_type":          "code",
			"include_granted_scopes": "true",
			"access_type":            "offline",
		}
		a.Client.ExchangeParameters = map[string]string{
			"grant_type": "authorization_code",
		}
		a.Client.ScopeSeparator = " "
	}
	return a.Client
}