package googleauth

import "github.com/google/gnostic/plugins/gnostic-go-generator/examples/googleauth"

Index

Functions

func NewOAuth2Client

func NewOAuth2Client(scopes ...string) (*http.Client, error)

NewOAuth2Client takes the user through the three-legged OAuth flow. It opens a browser in the native OS or outputs a URL, then blocks until the redirect completes to the /oauth2callback URI. It returns an instance of an HTTP client that can be passed to the constructor of an OAuth client. scopes is a variable number of OAuth scopes

func NewOAuth2TokenSource

func NewOAuth2TokenSource(scopes ...string) (oauth2.TokenSource, error)

NewOAuth2TokenSource takes the user through the three-legged OAuth flow. It opens a browser in the native OS or outputs a URL, then blocks until the redirect completes to the /oauth2callback URI. It returns an instance of an OAuth token source that can be passed to the constructor of an OAuth client. scopes is a variable number of OAuth scopes

Types

type ClientConfig

type ClientConfig struct {
	ClientID     string   `json:"client_id"`
	ClientSecret string   `json:"client_secret"`
	RedirectURIs []string `json:"redirect_uris"`
	AuthURI      string   `json:"auth_uri"`
	TokenURI     string   `json:"token_uri"`
}

ClientConfig is a data structure definition for the client_secrets.json file. The code unmarshals the JSON configuration file into this structure.

type Config

type Config struct {
	Installed ClientConfig `json:"installed"`
	Web       ClientConfig `json:"web"`
}

Config is a root-level configuration object.

Source Files

googleauth.go

Version
v0.2.2
Published
May 19, 2018
Platform
js/wasm
Imports
13 packages
Last checked
34 minutes ago

Tools for package owners.