github

package
v0.0.0-...-904d84a Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 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 GithubProvider

type GithubProvider struct {
	*Config
}

GithubProvider provide login with github method

func New

func New(config *Config) *GithubProvider

func (GithubProvider) Callback

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

Callback implement Callback with github provider

func (GithubProvider) ConfigAuth

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

ConfigAuth config auth

func (GithubProvider) GetName

func (GithubProvider) GetName() string

GetName return provider name

func (GithubProvider) Login

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

Login implemented login with github provider

func (GithubProvider) Logout

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

Logout implemented logout with github provider

func (GithubProvider) OAuthConfig

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

OAuthConfig return oauth config based on configuration

func (GithubProvider) Register

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

Register implemented register with github provider

func (GithubProvider) ServeHTTP

func (GithubProvider) 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