Versions in this module Expand all Collapse all v1 v1.0.10 Oct 24, 2024 v1.0.9 Oct 24, 2024 v1.0.8 Oct 24, 2024 v1.0.7 Oct 24, 2024 v1.0.6 Oct 15, 2024 v1.0.3 Sep 26, 2024 v1.0.2 Sep 26, 2024 v1.0.1 Sep 26, 2024 Changes in this version + const GoogleIdTokenKey + const Web3AuthTokenKey + var Lock sync.RWMutex + var WechatCacheMap map[string]WechatCacheMapValue + func BuildWechatOpenIdKey(appId string) string + func GetWechatOfficialAccountAccessToken(clientId string, clientSecret string) (string, string, error) + func GetWechatOfficialAccountQRCode(clientId string, clientSecret string, providerId string) (string, string, error) + func VerifyWechatSignature(token string, nonce string, timestamp string, signature string) bool + type AdfsIdProvider struct + Client *http.Client + Config *oauth2.Config + Host string + func NewAdfsIdProvider(clientId string, clientSecret string, redirectUrl string, hostUrl string) *AdfsIdProvider + func (idp *AdfsIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *AdfsIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *AdfsIdProvider) SetHttpClient(client *http.Client) + type AdfsToken struct + ErrMsg string + ExpiresIn int + IdToken string + type AlipayAccessToken struct + Response AlipaySystemOauthTokenResponse + Sign string + type AlipayIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewAlipayIdProvider(clientId string, clientSecret string, redirectUrl string) *AlipayIdProvider + func (idp *AlipayIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *AlipayIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *AlipayIdProvider) SetHttpClient(client *http.Client) + type AlipaySystemOauthTokenResponse struct + AccessToken string + AlipayUserId string + ExpiresIn int + ReExpiresIn int + RefreshToken string + UserId string + type AlipayUserInfoShareResponse struct + Avatar string + Code string + Msg string + NickName string + UserId string + type AlipayUserResponse struct + AlipayUserInfoShareResponse AlipayUserInfoShareResponse + Sign string + type AzureADB2CProvider struct + Client *http.Client + Config *oauth2.Config + Tenant string + UserFlow string + func NewAzureAdB2cProvider(clientId, clientSecret, redirectUrl, tenant string, userFlow string) *AzureADB2CProvider + func (p *AzureADB2CProvider) GetToken(code string) (*oauth2.Token, error) + func (p *AzureADB2CProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (p *AzureADB2CProvider) SetHttpClient(client *http.Client) + type AzureadB2cToken struct + IdToken string + IdTokenExpiresIn int + NotBefore int + ProfileInfo string + Scope string + TokenType string + type BaiduIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewBaiduIdProvider(clientId string, clientSecret string, redirectUrl string) *BaiduIdProvider + func (idp *BaiduIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *BaiduIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *BaiduIdProvider) SetHttpClient(client *http.Client) + type BaiduUserInfo struct + OpenId string + Portrait string + Username string + type BilibiliIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewBilibiliIdProvider(clientId string, clientSecret string, redirectUrl string) *BilibiliIdProvider + func (idp *BilibiliIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *BilibiliIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *BilibiliIdProvider) SetHttpClient(client *http.Client) + type BilibiliIdProviderTokenResponse struct + Code int + Data BilibiliProviderToken + Message string + TTL int + type BilibiliProviderToken struct + AccessToken string + ExpiresIn int + RefreshToken string + type BilibiliUserInfo struct + Face string + Name string + OpenId string + type BilibiliUserInfoResponse struct + Code int + Data BilibiliUserInfo + Message string + TTL int + type CasdoorIdProvider struct + Client *http.Client + Config *oauth2.Config + Host string + func NewCasdoorIdProvider(clientId string, clientSecret string, redirectUrl string, hostUrl string) *CasdoorIdProvider + func (idp *CasdoorIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *CasdoorIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *CasdoorIdProvider) SetHttpClient(client *http.Client) + type CasdoorToken struct + AccessToken string + ExpiresIn int + type CasdoorUserInfo struct + AvatarUrl string + DisplayName string + Email string + Id string + Msg string + Name string + Status string + type CustomIdProvider struct + AuthURL string + Client *http.Client + Config *oauth2.Config + Scopes []string + TokenURL string + UserInfoURL string + UserMapping map[string]string + func NewCustomIdProvider(idpInfo *ProviderInfo, redirectUrl string) *CustomIdProvider + func (idp *CustomIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *CustomIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *CustomIdProvider) SetHttpClient(client *http.Client) + type CustomUserInfo struct + AvatarUrl string + DisplayName string + Email string + Id string + Username string + type DingTalkAccessToken struct + AccessToken string + ErrCode int + ErrMsg string + ExpiresIn int64 + type DingTalkIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewDingTalkIdProvider(clientId string, clientSecret string, redirectUrl string) *DingTalkIdProvider + func (idp *DingTalkIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *DingTalkIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *DingTalkIdProvider) SetHttpClient(client *http.Client) + type DingTalkUserResponse struct + AvatarUrl string + Email string + Mobile string + Nick string + OpenId string + StateCode string + UnionId string + type DouyinIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewDouyinIdProvider(clientId string, clientSecret string, redirectUrl string) *DouyinIdProvider + func (idp *DouyinIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *DouyinIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *DouyinIdProvider) SetHttpClient(client *http.Client) + type DouyinTokenResp struct + Data struct{ ... } + Message string + type DouyinUserInfo struct + Data struct{ ... } + type FacebookAccessToken struct + AccessToken string + ExpiresIn int64 + TokenType string + type FacebookCheckToken struct + Data string + type FacebookCheckTokenData struct + UserId string + type FacebookIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewFacebookIdProvider(clientId string, clientSecret string, redirectUrl string) *FacebookIdProvider + func (idp *FacebookIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *FacebookIdProvider) GetUrlResp(url string) (string, error) + func (idp *FacebookIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *FacebookIdProvider) SetHttpClient(client *http.Client) + type FacebookUserInfo struct + Email string + Id string + Name string + NameFormat string + Picture struct{ ... } + type GitHubUserInfo struct + AvatarUrl string + Bio string + Blog string + Collaborators int + Company string + CreatedAt time.Time + DiskUsage int + Email string + EventsUrl string + Followers int + FollowersUrl string + Following int + FollowingUrl string + GistsUrl string + GravatarId string + Hireable bool + HtmlUrl string + Id int + Location string + Login string + Name string + NodeId string + OrganizationsUrl string + OwnedPrivateRepos int + Plan struct{ ... } + PrivateGists int + PublicGists int + PublicRepos int + ReceivedEventsUrl string + ReposUrl string + SiteAdmin bool + StarredUrl string + SubscriptionsUrl string + TotalPrivateRepos int + TwitterUsername interface{} + TwoFactorAuthentication bool + Type string + UpdatedAt time.Time + Url string + type GiteeAccessToken struct + AccessToken string + CreatedAt int + ExpiresIn int + RefreshToken string + Scope string + TokenType string + type GiteeIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewGiteeIdProvider(clientId string, clientSecret string, redirectUrl string) *GiteeIdProvider + func (idp *GiteeIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *GiteeIdProvider) GetUrlResp(url string) (string, error) + func (idp *GiteeIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *GiteeIdProvider) SetHttpClient(client *http.Client) + type GiteeUserResponse struct + AvatarUrl string + Bio string + Blog string + CreatedAt string + Email string + EventsUrl string + Followers int + FollowersUrl string + Following int + FollowingUrl string + GistsUrl string + HtmlUrl string + Id int + Login string + MemberRole string + Name string + OrganizationsUrl string + PublicGists int + PublicRepos int + ReceivedEventsUrl string + ReposUrl string + Stared int + StarredUrl string + SubscriptionsUrl string + Type string + UpdatedAt string + Url string + Watched int + Weibo string + type GithubIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewGithubIdProvider(clientId string, clientSecret string, redirectUrl string) *GithubIdProvider + func (idp *GithubIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *GithubIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *GithubIdProvider) SetHttpClient(client *http.Client) + type GithubToken struct + AccessToken string + Error string + Scope string + TokenType string + type GitlabIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewGitlabIdProvider(clientId string, clientSecret string, redirectUrl string) *GitlabIdProvider + func (idp *GitlabIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *GitlabIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *GitlabIdProvider) SetHttpClient(client *http.Client) + type GitlabProviderToken struct + AccessToken string + CreatedAt int + ExpiresIn int + RefreshToken string + TokenType string + type GitlabUserInfo struct + AvatarUrl string + Bio string + BioHtml string + Bot bool + CanCreateGroup bool + CanCreateProject bool + ColorSchemeId int + CommitEmail string + ConfirmedAt time.Time + CreatedAt time.Time + CurrentSignInAt time.Time + Email string + External bool + ExtraSharedRunnersMinutesLimit interface{} + Followers int + Following int + Id int + Identities []struct{ ... } + JobTitle string + LastActivityOn string + LastSignInAt time.Time + Linkedin string + Location string + Name string + Organization string + PrivateProfile bool + ProjectsLimit int + Pronouns interface{} + PublicEmail string + SharedRunnersMinutesLimit interface{} + Skype string + State string + ThemeId int + Twitter string + TwoFactorEnabled bool + Username string + WebUrl string + WebsiteUrl string + WorkInformation interface{} + type GoogleIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewGoogleIdProvider(clientId string, clientSecret string, redirectUrl string) *GoogleIdProvider + func (idp *GoogleIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *GoogleIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *GoogleIdProvider) SetHttpClient(client *http.Client) + type GoogleIdToken struct + Aud string + Azp string + Email string + EmailVerified string + Exp string + FamilyName string + GivenName string + Iat string + Iss string + Locale string + Name string + Picture string + Sub string + type GooglePeopleApiPhoneNumber struct + CanonicalForm string + MetaData GooglePeopleApiPhoneNumberMetaData + Type string + Value string + type GooglePeopleApiPhoneNumberMetaData struct + Primary bool + type GooglePeopleApiResult struct + Etag string + PhoneNumbers []GooglePeopleApiPhoneNumber + ResourceName string + type GoogleUserInfo struct + Email string + FamilyName string + GivenName string + Id string + Locale string + Name string + Picture string + VerifiedEmail bool + type GothIdProvider struct + Provider goth.Provider + Session goth.Session + func NewGothIdProvider(providerType string, clientId string, clientSecret string, clientId2 string, ...) (*GothIdProvider, error) + func (idp *GothIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *GothIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *GothIdProvider) SetHttpClient(client *http.Client) + type IdProvider interface + GetToken func(code string) (*oauth2.Token, error) + GetUserInfo func(token *oauth2.Token) (*UserInfo, error) + SetHttpClient func(client *http.Client) + func GetIdProvider(idpInfo *ProviderInfo, redirectUrl string) (IdProvider, error) + type InfoflowIdProvider struct + AgentId string + Client *http.Client + Config *oauth2.Config + Ticket string + func NewInfoflowIdProvider(clientId string, clientSecret string, appId string, redirectUrl string) *InfoflowIdProvider + func (idp *InfoflowIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *InfoflowIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *InfoflowIdProvider) SetHttpClient(client *http.Client) + type InfoflowInterToken struct + AccessToken string + Errcode int + Errmsg string + type InfoflowInternalIdProvider struct + AgentId string + Client *http.Client + Config *oauth2.Config + func NewInfoflowInternalIdProvider(clientId string, clientSecret string, appId string, redirectUrl string) *InfoflowInternalIdProvider + func (idp *InfoflowInternalIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *InfoflowInternalIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *InfoflowInternalIdProvider) SetHttpClient(client *http.Client) + type InfoflowInternalUserInfo struct + Avatar string + Email string + Errcode int + Errmsg string + Imid int + Name string + UserId string + type InfoflowInternalUserResp struct + Errcode int + Errmsg string + UserId string + type InfoflowToken struct + AccessToken string + Errcode int + Errmsg string + ExpiresIn int + type InfoflowUserInfo struct + Email string + Errcode int + Errmsg string + Imid string + Name string + type InfoflowUserResp struct + Errcode int + Errmsg string + UserId string + type LarkAccessToken struct + Code int + Expire int + Msg string + TenantAccessToken string + type LarkIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewLarkIdProvider(clientId string, clientSecret string, redirectUrl string) *LarkIdProvider + func (idp *LarkIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *LarkIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *LarkIdProvider) SetHttpClient(client *http.Client) + type LarkUserInfo struct + Code int + Data struct{ ... } + Msg string + type LinkedInAccessToken struct + AccessToken string + ExpiresIn int64 + type LinkedInIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewLinkedInIdProvider(clientId string, clientSecret string, redirectUrl string) *LinkedInIdProvider + func (idp *LinkedInIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *LinkedInIdProvider) GetUrlRespWithAuthorization(url, token string) ([]byte, error) + func (idp *LinkedInIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *LinkedInIdProvider) SetHttpClient(client *http.Client) + type LinkedInUserEmail struct + Elements []struct{ ... } + type LinkedInUserInfo struct + FirstName struct{ ... } + Id string + LastName struct{ ... } + ProfilePicture struct{ ... } + type MetaMaskIdProvider struct + Client *http.Client + func NewMetaMaskIdProvider() *MetaMaskIdProvider + func (idp *MetaMaskIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *MetaMaskIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *MetaMaskIdProvider) SetHttpClient(client *http.Client) + type OktaIdProvider struct + Client *http.Client + Config *oauth2.Config + Host string + func NewOktaIdProvider(clientId string, clientSecret string, redirectUrl string, hostUrl string) *OktaIdProvider + func (idp *OktaIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *OktaIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *OktaIdProvider) SetHttpClient(client *http.Client) + type OktaToken struct + AccessToken string + ExpiresIn int + IdToken string + RefreshToken string + Scope string + TokenType string + type OktaUserInfo struct + Email string + Name string + Picture string + PreferredUsername string + Sub string + type ProviderInfo struct + AppId string + AuthURL string + ClientId string + ClientId2 string + ClientSecret string + ClientSecret2 string + HostUrl string + RedirectUrl string + SubType string + TokenURL string + Type string + UserInfoURL string + UserMapping map[string]string + type QqIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewQqIdProvider(clientId string, clientSecret string, redirectUrl string) *QqIdProvider + func (idp *QqIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *QqIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *QqIdProvider) SetHttpClient(client *http.Client) + type QqUserInfo struct + City string + Constellation string + Figureurl string + Figureurl1 string + Figureurl2 string + FigureurlQq string + FigureurlQq1 string + FigureurlQq2 string + FigureurlType string + Gender string + GenderType int + IsLost int + IsYellowVip string + IsYellowYearVip string + Level string + Msg string + Nickname string + Province string + Ret int + Vip string + Year string + YellowVipLevel string + type TwitterAccessToken struct + AccessToken string + ExpiresIn int64 + TokenType string + type TwitterCheckToken struct + Data TwitterUserInfo + type TwitterCheckTokenData struct + UserId string + type TwitterIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewTwitterIdProvider(clientId string, clientSecret string, redirectUrl string) *TwitterIdProvider + func (idp *TwitterIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *TwitterIdProvider) GetUrlResp(url *http.Request) (string, error) + func (idp *TwitterIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *TwitterIdProvider) SetHttpClient(client *http.Client) + type TwitterUserInfo struct + Email string + Id string + Name string + Picture struct{ ... } + UserName string + type UserInfo struct + AvatarUrl string + CountryCode string + DisplayName string + Email string + Extra map[string]string + Id string + Phone string + UnionId string + Username string + type WeChatIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewWeChatIdProvider(clientId string, clientSecret string, redirectUrl string) *WeChatIdProvider + func (idp *WeChatIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *WeChatIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *WeChatIdProvider) SetHttpClient(client *http.Client) + type WeChatMiniProgramIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewWeChatMiniProgramIdProvider(clientId string, clientSecret string) *WeChatMiniProgramIdProvider + func (idp *WeChatMiniProgramIdProvider) GetSessionByCode(code string) (*WeChatMiniProgramSessionResponse, error) + func (idp *WeChatMiniProgramIdProvider) SetHttpClient(client *http.Client) + type WeChatMiniProgramSessionResponse struct + Errcode int + Errmsg string + Openid string + SessionKey string + Unionid string + type WeComIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewWeComIdProvider(clientId string, clientSecret string, redirectUrl string) *WeComIdProvider + func (idp *WeComIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *WeComIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *WeComIdProvider) SetHttpClient(client *http.Client) + type WeComInternalIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewWeComInternalIdProvider(clientId string, clientSecret string, redirectUrl string) *WeComInternalIdProvider + func (idp *WeComInternalIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *WeComInternalIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *WeComInternalIdProvider) SetHttpClient(client *http.Client) + type WeComProviderToken struct + Errcode int + Errmsg string + ExpiresIn int + ProviderAccessToken string + type WeComUserInfo struct + Agent []struct{ ... } + AuthInfo struct{ ... } + CorpInfo struct{ ... } + Errcode int + Errmsg string + UserInfo struct{ ... } + Usertype int + type Web3AuthToken struct + Address string + CreateAt uint64 + Nonce string + Signature string + TypedData string + WalletType string + type Web3OnboardIdProvider struct + Client *http.Client + func NewWeb3OnboardIdProvider() *Web3OnboardIdProvider + func (idp *Web3OnboardIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *Web3OnboardIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *Web3OnboardIdProvider) SetHttpClient(client *http.Client) + type WechatAccessToken struct + AccessToken string + ExpiresIn int64 + Openid string + RefreshToken string + Scope string + Unionid string + type WechatCacheMapValue struct + IsScanned bool + WechatUnionId string + type WechatUserInfo struct + City string + Country string + Headimgurl string + Language string + Nickname string + Openid string + Privilege []string + Province string + Sex int + Unionid string + type WecomInterToken struct + AccessToken string + Errcode int + Errmsg string + ExpiresIn int + type WecomInternalUserInfo struct + Avatar string + Email string + Errcode int + Errmsg string + Name string + OpenId string + UserId string + type WecomInternalUserResp struct + Errcode int + Errmsg string + OpenId string + UserId string + type WeiBoIdProvider struct + Client *http.Client + Config *oauth2.Config + func NewWeiBoIdProvider(clientId string, clientSecret string, redirectUrl string) *WeiBoIdProvider + func (idp *WeiBoIdProvider) GetToken(code string) (*oauth2.Token, error) + func (idp *WeiBoIdProvider) GetUrlResp(url string) (string, error) + func (idp *WeiBoIdProvider) GetUserInfo(token *oauth2.Token) (*UserInfo, error) + func (idp *WeiBoIdProvider) SetHttpClient(client *http.Client) + type WeiboAccessToken struct + AccessToken string + ExpiresIn int + RemindIn string + Uid string + type WeiboUserinfo struct + AllowAllActMsg bool + AllowAllComment bool + AvatarLarge string + BiFollowersCount int + City string + CreatedAt string + Description string + Domain string + FavouritesCount int + FollowMe bool + FollowersCount int + Following bool + FriendsCount int + Gender string + GeoEnabled bool + Id int + Location string + Name string + OnlineStatus int + ProfileImageUrl string + Province string + ScreenName string + Status struct{ ... } + StatusesCount int + Url string + Verified bool + VerifiedReason string