oauth

package
v0.0.0-...-20406e5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IOAuth2

type IOAuth2 interface {
	GetClient() *oauth2.Config
	AuthCodeUrl(state, verifier string) string
	Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
}

func NewOAuth2

func NewOAuth2(config OAuth2Config) IOAuth2

type OAuth2

type OAuth2 struct {
	Config OAuth2Config
}

func (*OAuth2) AuthCodeUrl

func (o *OAuth2) AuthCodeUrl(state, verifier string) string

func (*OAuth2) Exchange

func (o *OAuth2) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

func (*OAuth2) GetClient

func (o *OAuth2) GetClient() *oauth2.Config

type OAuth2Config

type OAuth2Config struct {
	ClientId     string
	ClientSecret string
	Scopes       []string
	Endpoint     oauth2.Endpoint
	Redirect     string
}

Jump to

Keyboard shortcuts

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