sso4thunder

package module
v0.0.0-...-9f86fc0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

README

sso4thunder

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoint     string   `toml: "endpoint"`
	ClientId     string   `toml:"client_id"`
	ClientSecret string   `toml:"client_secret"`
	RedirectUrl  string   `toml:"redirect_url"`
	Scope        []string `toml:"scope"`
}

type SSO

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

func New

func New(conf Config) *SSO

func (*SSO) AuthorizeURL

func (s *SSO) AuthorizeURL(state string, opts ...oauth2.AuthCodeOption) string

func (*SSO) ExchangeToken

func (s *SSO) ExchangeToken(ctx context.Context, code string) (*oauth2.Token, error)

func (*SSO) UserInfo

func (s *SSO) UserInfo(ctx context.Context, code string) (*UserInfo, error)

使用Code获取用户信息

type UserInfo

type UserInfo struct {
	Id     string `json:"id"`
	Name   string `json:"name"`
	Avatar string `json:"avatar"`
	Email  string `json:"email"`
}

SSO用户信息

Jump to

Keyboard shortcuts

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