wx

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AuthorizeURL = "https://github.com/login/oauth/authorize"
	TokenURL     = "https://github.com/login/oauth/access_token"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientID         string
	ClientSecret     string
	AuthorizeURL     string
	TokenURL         string
	RedirectURL      string
	Scopes           []string
	AuthorizeHandler func(*auth.Context) (*claims.Claims, error)
}

Config github Config

type WxProvider

type WxProvider struct {
	*Config
}

GithubProvider provide login with github method

func New

func New(config *Config) *WxProvider

func (WxProvider) Callback

func (provider WxProvider) Callback(context *auth.Context)

Callback implement Callback with github provider

func (WxProvider) ConfigAuth

func (provider WxProvider) ConfigAuth(*auth.Auth)

ConfigAuth config auth

func (WxProvider) GetName

func (WxProvider) GetName() string

GetName return provider name

func (WxProvider) Login

func (provider WxProvider) Login(context *auth.Context)

Login implemented login with github provider

func (WxProvider) Logout

func (WxProvider) Logout(context *auth.Context)

Logout implemented logout with github provider

func (WxProvider) OAuthConfig

func (provider WxProvider) OAuthConfig(context *auth.Context) *oauth2.Config

OAuthConfig return oauth config based on configuration

func (WxProvider) Register

func (provider WxProvider) Register(context *auth.Context)

Register implemented register with github provider

func (WxProvider) ServeHTTP

func (WxProvider) ServeHTTP(*auth.Context)

ServeHTTP implement ServeHTTP with github provider

Jump to

Keyboard shortcuts

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