oauth2

package
v0.0.44 Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOAuth2Client

func NewOAuth2Client(conf *Config) (*http.Client, error)

func NewOAuth2ClientWithContext

func NewOAuth2ClientWithContext(ctx context.Context, conf *Config) (*http.Client, error)

Types

type Config

type Config struct {
	GrantType string

	// Username used only when grant_type == password.
	Username string

	// Password  used only when grant_type == password
	Password string

	// ClientID is the application's ID.
	ClientID string

	// ClientSecret is the application's secret.
	ClientSecret string

	// AuthURL is the resource server's token endpoint
	// Host. This is a constant specific to each server.
	// Used only when grant_type ==  authorization_code
	AuthURL string

	// RedirectURL is the Host to redirect users going through
	// the OAuth flow, after the resource owner's URLs.
	// Used only when grant_type ==  authorization_code
	RedirectURL string

	// TokenURL is the resource server's token endpoint
	// Host. This is a constant specific to each server.
	TokenURL string

	// Scope specifies optional requested permissions.
	Scopes []string

	// EndpointParams specifies additional parameters for requests to the token endpoint.
	EndpointParams url.Values

	// AuthStyle optionally specifies how the endpoint wants the
	// client ID & client secret sent. The zero value means to
	// auto-detect.
	AuthStyle oauth2.AuthStyle

	Timeout time.Duration
}

OAuth2 Config allowing to use

func (*Config) Clone added in v0.0.32

func (c *Config) Clone() *Config

Jump to

Keyboard shortcuts

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