qywechat

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessTokenUrl = "https://qyapi.weixin.qq.com/cgi-bin/gettoken"
	UserIdUrl      = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo"
	UserInfoUrl    = "https://qyapi.weixin.qq.com/cgi-bin/user/get"
)
View Source
const (
	AuthUrl = "https://open.work.weixin.qq.com/wwopen/sso/qrConnect"
)

Variables

This section is empty.

Functions

func NewQywxOAuth2Driver

func NewQywxOAuth2Driver(appId string, secret string) oauth2.IOAuth2Driver

Types

type Attr

type Attr struct {
	Type        int64        `json:"type"`
	Name        string       `json:"name"`
	Text        *Text        `json:"text,omitempty"`
	Web         *Web         `json:"web,omitempty"`
	Miniprogram *Miniprogram `json:"miniprogram,omitempty"`
}

type Extattr

type Extattr struct {
	Attrs []Attr `json:"attrs"`
}

type ExternalProfile

type ExternalProfile struct {
	ExternalCorpName string `json:"external_corp_name"`
	ExternalAttr     []Attr `json:"external_attr"`
}

type Miniprogram

type Miniprogram struct {
	Appid    string `json:"appid"`
	Pagepath string `json:"pagepath"`
	Title    string `json:"title"`
}

type SBaseData

type SBaseData struct {
	Errcode int    `json:"errcode"`
	Errmsg  string `json:"errmsg"`
}

type SQywxDriverFactory

type SQywxDriverFactory struct{}

func (SQywxDriverFactory) IdpAttributeOptions

func (drv SQywxDriverFactory) IdpAttributeOptions() api.SIdpAttributeOptions

func (SQywxDriverFactory) NewDriver

func (drv SQywxDriverFactory) NewDriver(appId string, secret string) oauth2.IOAuth2Driver

func (SQywxDriverFactory) TemplateName

func (drv SQywxDriverFactory) TemplateName() string

func (SQywxDriverFactory) ValidateConfig

func (drv SQywxDriverFactory) ValidateConfig(conf api.SOAuth2IdpConfigOptions) error

type SQywxOAuth2Driver

type SQywxOAuth2Driver struct {
	oauth2.SOAuth2BaseDriver
}

func (*SQywxOAuth2Driver) Authenticate

func (drv *SQywxOAuth2Driver) Authenticate(ctx context.Context, code string) (map[string][]string, error)

func (*SQywxOAuth2Driver) GetSsoRedirectUri

func (drv *SQywxOAuth2Driver) GetSsoRedirectUri(ctx context.Context, callbackUrl, state string) (string, error)

type Text

type Text struct {
	Value string `json:"value"`
}

type Web

type Web struct {
	URL   string `json:"url"`
	Title string `json:"title"`
}

Jump to

Keyboard shortcuts

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