oauth2

package
v0.0.4-0...-ffe3ecb Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationCode

type AuthorizationCode struct {
	B []byte
	// contains filtered or unexported fields
}

AuthorizationCode represent the config type for the authorization code grant type

func (*AuthorizationCode) Client

func (a *AuthorizationCode) Client(token *oauth2.Token) *http.Client

Client returns an HTTP client using the provided token. The token will auto-refresh as necessary. The returned client should not be modified.

func (*AuthorizationCode) Token

func (a *AuthorizationCode) Token() (*oauth2.Token, error)

Token generates a *oauth2.Token. The token will be cached in token.json. Refreshtoken might not work properly.

type ClientCredentials

type ClientCredentials struct {
	B []byte
	// contains filtered or unexported fields
}

ClientCredentials represent the config type for the authorization code grant type

func (*ClientCredentials) Client

func (a *ClientCredentials) Client(token *oauth2.Token) *http.Client

Client returns an HTTP client using the provided token. The token will auto-refresh as necessary. The returned client should not be modified

func (*ClientCredentials) Token

func (a *ClientCredentials) Token() (*oauth2.Token, error)

Token retrieves an Oauth2 token based on the credentials retrieved from a file

type Config

type Config interface {
	Token() (*oauth2.Token, error)
	Client(token *oauth2.Token) *http.Client
}

Config generalizes oauth2 config types. Currently supporting:

  • oauth2.Config
  • oauth2/clientcredentials.Config

Jump to

Keyboard shortcuts

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