oauth2client

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

README

oauth2client

an oauth2 client for login

Documentation

Overview

Package example (an authclient plugin).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error)

Types

type Config

type Config struct {

	// ...
	AuthURL      string `json:"authURL,omitempty"`
	ClientID     string `json:"clientID,omitempty"`
	UserInfo     string `json:"userinfo,omitempty"`
	ResponseType string `json:"responsetype,omitempty"`
	RedirectURL  string `json:"redirectURL,omitempty"`
}

Config the plugin configuration.

func CreateConfig

func CreateConfig() *Config

CreateConfig creates the default plugin configuration. 创建默认的参数配置

type OauthClient

type OauthClient struct {
	// contains filtered or unexported fields
}

Example a plugin. 插件的结构体

func (*OauthClient) ServeHTTP

func (oc *OauthClient) ServeHTTP(rw http.ResponseWriter, req *http.Request)

具体的http服务

Jump to

Keyboard shortcuts

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