gcp_oauth2

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ScopeEmail   = "https://www.googleapis.com/auth/userinfo.email"
	ScopeProfile = "https://www.googleapis.com/auth/userinfo.profile"
)
View Source
var (
	EndpointUserInfo = "https://www.googleapis.com/oauth2/v3/userinfo"
)

Functions

This section is empty.

Types

type Manager

type Manager interface {
	ExchangeWithCode(ctx context.Context, code string) (client *OAuthClient, err error)
	GetLoginUrlWithState(state string) (url string)
	GetLoginUrl() (state string, url string)
	GetRandomState() string
}

func NewManager

func NewManager(oauthId, oauthSecret, redirectURL string, scopes []string) (Manager, error)

type OAuthClient

type OAuthClient struct {
	Client *http.Client
	Token  *oauth2.Token
}

func (*OAuthClient) UserInfo

func (oc *OAuthClient) UserInfo() (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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