Documentation
¶
Index ¶
- Constants
- func GetOAuthURLIdentifierKey(state string) string
- type ExchangeAccessTokenResp
- type GetUserResp
- type OAuth
- func (oauth *OAuth) BuildAuthPageURL() (string, error)
- func (oauth *OAuth) ExchangeAccessToken(code string) (string, error)
- func (oauth *OAuth) GetUserInfoByAccessToken(accessToken string) (*GetUserResp, error)
- func (oauth *OAuth) HandleOAuth2ByAPPAuthToken(token string) (*plugin.OAuthUser, error)
- func (oauth *OAuth) HandleOAuth2ByAuthCode(code *plugin.VerifyCode) (*plugin.OAuthUser, error)
- func (oauth *OAuth) Provide(ctx context.Context) any
- type Option
- type Options
- type User
Constants ¶
View Source
const ( // EndpointExchangeAccessTokenURL 交换用户授权的 access_token 的请求地址 EndpointExchangeAccessTokenURL = "https://api.instagram.com/oauth/access_token" // EndpointUserInfoURL 获取用户信息的请求地址 EndpointUserInfoURL = "https://graph.instagram.com/me" )
View Source
const (
OAuthUrlIdentifierKey = "instagram.oauth2.url.identifier.%s"
)
Variables ¶
This section is empty.
Functions ¶
func GetOAuthURLIdentifierKey ¶
GetOAuthURLIdentifierKey 获取 OAuth URL 标识键
Types ¶
type ExchangeAccessTokenResp ¶
type GetUserResp ¶
type OAuth ¶
type OAuth struct {
// contains filtered or unexported fields
}
func (*OAuth) BuildAuthPageURL ¶
BuildAuthPageURL 构建授权页面 URL
func (*OAuth) ExchangeAccessToken ¶
ExchangeAccessToken 交换用户授权的 access_token
func (*OAuth) GetUserInfoByAccessToken ¶
func (oauth *OAuth) GetUserInfoByAccessToken(accessToken string) (*GetUserResp, error)
GetUserInfoByAccessToken 通过 access_token 获取用户信息
func (*OAuth) HandleOAuth2ByAPPAuthToken ¶
HandleOAuth2ByAPPAuthToken 处理 APP 授权登录
func (*OAuth) HandleOAuth2ByAuthCode ¶
type Option ¶
type Option func(o *Options)
func WithClientID ¶
func WithClientSecret ¶
func WithRedirectURL ¶
Click to show internal directories.
Click to hide internal directories.