oauth2

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OauthRedirector

func OauthRedirector(oauthConfig *oauth2.Config) func(w http.ResponseWriter, r *http.Request)

Types

type BaseOAuth2

type BaseOAuth2 struct {
	ClientId       string
	ClientSecret   string
	CallbackURL    string
	HandleUser     HandleUserFunc
	AuthFailureUrl string
	// contains filtered or unexported fields
}

func NewBaseOAuth2

func NewBaseOAuth2(clientId string, clientSecret string, callbackUrl string, handleUser HandleUserFunc) *BaseOAuth2

func (*BaseOAuth2) Handler added in v0.0.2

func (b *BaseOAuth2) Handler() http.Handler

type GithubOAuth2

type GithubOAuth2 struct {
	*BaseOAuth2
}

func NewGithubOAuth2

func NewGithubOAuth2(clientId string, clientSecret string, callbackUrl string, handleUser HandleUserFunc) *GithubOAuth2

type GoogleOAuth2

type GoogleOAuth2 struct {
	*BaseOAuth2
}

func NewGoogleOAuth2

func NewGoogleOAuth2(clientId string, clientSecret string, callbackUrl string, handleUser HandleUserFunc) *GoogleOAuth2

type HandleUserFunc

type HandleUserFunc func(authtype string, provider string, token *oauth2.Token, userInfo map[string]any, w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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