providers

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlipayOption

type AlipayOption func(*AlipayProvider)

AlipayOption 支付宝提供者选项

func WithPublicKey

func WithPublicKey(publicKey string) AlipayOption

WithPublicKey 设置支付宝公钥

type AlipayProvider

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

AlipayProvider 支付宝登录提供者

func NewAlipayProvider

func NewAlipayProvider(clientID, clientSecret, redirectURL string, scopes []string, opts ...AlipayOption) *AlipayProvider

NewAlipayProvider 创建支付宝提供者

func (*AlipayProvider) AuthCodeURL

func (p *AlipayProvider) AuthCodeURL(state string, opts ...oauth.AuthCodeOption) string

AuthCodeURL 重写授权URL生成方法,适配支付宝特殊需求

func (*AlipayProvider) GetOAuth2Config

func (p *AlipayProvider) GetOAuth2Config() oauth.OAuth2Config

GetOAuth2Config 实现Provider接口

func (*AlipayProvider) GetUserInfo

func (p *AlipayProvider) GetUserInfo(ctx context.Context, token *oauth.Token) (*social.UserInfo, error)

GetUserInfo 实现Provider接口

func (*AlipayProvider) Name

func (p *AlipayProvider) Name() string

Name 实现Provider接口

type GitHubProvider

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

GitHubProvider GitHub登录提供者

func NewGitHubProvider

func NewGitHubProvider(clientID, clientSecret, redirectURL string, scopes []string) *GitHubProvider

NewGitHubProvider 创建GitHub提供者

func (*GitHubProvider) GetOAuth2Config

func (p *GitHubProvider) GetOAuth2Config() oauth.OAuth2Config

GetOAuth2Config 实现Provider接口

func (*GitHubProvider) GetUserInfo

func (p *GitHubProvider) GetUserInfo(ctx context.Context, token *oauth.Token) (*social.UserInfo, error)

GetUserInfo 实现Provider接口

func (*GitHubProvider) Name

func (p *GitHubProvider) Name() string

Name 实现Provider接口

type GoogleProvider

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

GoogleProvider Google登录提供者

func NewGoogleProvider

func NewGoogleProvider(clientID, clientSecret, redirectURL string, scopes []string) *GoogleProvider

NewGoogleProvider 创建Google提供者

func (*GoogleProvider) GetOAuth2Config

func (p *GoogleProvider) GetOAuth2Config() oauth.OAuth2Config

GetOAuth2Config 实现Provider接口

func (*GoogleProvider) GetUserInfo

func (p *GoogleProvider) GetUserInfo(ctx context.Context, token *oauth.Token) (*social.UserInfo, error)

GetUserInfo 实现Provider接口

func (*GoogleProvider) Name

func (p *GoogleProvider) Name() string

Name 实现Provider接口

type WechatOption

type WechatOption func(*WechatProvider)

WechatOption 微信提供者选项

func WithMP

func WithMP() WechatOption

WithMP 设置为公众号模式

func WithMiniProgram

func WithMiniProgram() WechatOption

WithMiniProgram 设置为小程序模式

type WechatProvider

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

WechatProvider 微信登录提供者

func NewWechatProvider

func NewWechatProvider(clientID, clientSecret, redirectURL string, scopes []string, opts ...WechatOption) *WechatProvider

NewWechatProvider 创建微信提供者

func (*WechatProvider) AuthCodeURL

func (p *WechatProvider) AuthCodeURL(state string, opts ...oauth.AuthCodeOption) string

AuthCodeURL 重写授权URL生成方法,适配微信特殊需求

func (*WechatProvider) GetOAuth2Config

func (p *WechatProvider) GetOAuth2Config() oauth.OAuth2Config

GetOAuth2Config 实现Provider接口

func (*WechatProvider) GetUserInfo

func (p *WechatProvider) GetUserInfo(ctx context.Context, token *oauth.Token) (*social.UserInfo, error)

GetUserInfo 实现Provider接口

func (*WechatProvider) Name

func (p *WechatProvider) Name() string

Name 实现Provider接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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