oauth

package
v0.0.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserInfoNotReceived = fmt.Errorf("user info not received")
)

Functions

This section is empty.

Types

type Provider

type Provider interface {
	GetConsentPageUrl(redirectUrl string) (string, string)
	ExchangeCodeToToken(ctx context.Context, code string, redirectUrl string) (*oauth2.Token, error)
	GetUserInfo(ctx context.Context, token *oauth2.Token) (UserInfo, error)
}

func NewProvider

func NewProvider(oauthConfig *oauth2.Config, userInfoUrl string, unmarshallUserInfo UnmarshallUserInfo) Provider

type UnmarshallUserInfo

type UnmarshallUserInfo = func(bytes []byte) (UserInfo, error)

type UserInfo

type UserInfo struct {
	Username        string
	Email           string
	IsEmailVerified bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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