oauth

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package oauth implements functions to diagnose the supported OAuth2 flows (web and installed app flows) in a Google Ads API client library client environment.

Package oauth contains functions that are specific to web OAuth flow. The web flow initially prompts user to login, grant permission, and redirects user back to the redirect URL specified in Google Cloud project.

Package oauth contains functions that are specific to web OAuth flow. The web flow initially prompts user to login, grant permission, and redirects user back to the redirect URL specified in Google Cloud project.

Index

Constants

View Source
const (
	AccessNotPermittedForManagerAccount = iota
	GoogleAdsAPIDisabled
	InvalidClientInfo
	InvalidRefreshToken
	InvalidCustomerID
	MissingDevToken
	Unauthenticated
	Unauthorized
	UnknownError

	GoogleAdsApiScope = "https://www.googleapis.com/auth/adwords"
)

This is a list of error codes (not comprehensive) returned by Google OAuth2 endpoint based on Google Ads API scope.

View Source
const (
	// InstalledAppRedirectURL is the redirect URL for the web flow.
	InstalledAppRedirectURL = "urn:ietf:wg:oauth:2.0:oob"
)

Variables

This section is empty.

Functions

func ReadCustomerID

func ReadCustomerID() string

ReadCustomerID retrieves the CID from stdin.

Types

type Config

type Config struct {
	ConfigFile diag.ConfigFile
	CustomerID string
	OAuthType  string
	Verbose    bool
}

Config is a required configuration for diagnosing the OAuth2 flow based on the client library configuration.

func (*Config) SimulateOAuthFlow

func (c *Config) SimulateOAuthFlow()

SimulateOAuthFlow simulates the OAuth2 flows supported by the Google Ads API client libraries.

type ConfigWriter added in v1.0.4

type ConfigWriter interface {
	ReplaceConfig(k, v string) string
}

ConfigWriter allows replacement of key by a given value in a configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL