Versions in this module Expand all Collapse all v0 v0.16.0 Apr 28, 2023 Changes in this version + const NameApple + const NameDiscord + const NameFacebook + const NameGitea + const NameGitee + const NameGithub + const NameGitlab + const NameGoogle + const NameKakao + const NameLivechat + const NameMicrosoft + const NameOIDC + const NameSpotify + const NameStrava + const NameTwitch + const NameTwitter + type Apple struct + func NewAppleProvider() *Apple + func (p *Apple) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p *Apple) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Apple) AuthUrl() string + func (p Apple) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Apple) Client(token *oauth2.Token) *http.Client + func (p Apple) ClientId() string + func (p Apple) ClientSecret() string + func (p Apple) Context() context.Context + func (p Apple) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Apple) RedirectUrl() string + func (p Apple) Scopes() []string + func (p Apple) SetAuthUrl(url string) + func (p Apple) SetClientId(clientId string) + func (p Apple) SetClientSecret(secret string) + func (p Apple) SetContext(ctx context.Context) + func (p Apple) SetRedirectUrl(url string) + func (p Apple) SetScopes(scopes []string) + func (p Apple) SetTokenUrl(url string) + func (p Apple) SetUserApiUrl(url string) + func (p Apple) TokenUrl() string + func (p Apple) UserApiUrl() string + type AuthUser struct + AccessToken string + AvatarUrl string + Email string + Id string + Name string + RawUser map[string]any + RefreshToken string + Username string + type Discord struct + func NewDiscordProvider() *Discord + func (p *Discord) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Discord) AuthUrl() string + func (p Discord) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Discord) Client(token *oauth2.Token) *http.Client + func (p Discord) ClientId() string + func (p Discord) ClientSecret() string + func (p Discord) Context() context.Context + func (p Discord) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Discord) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Discord) RedirectUrl() string + func (p Discord) Scopes() []string + func (p Discord) SetAuthUrl(url string) + func (p Discord) SetClientId(clientId string) + func (p Discord) SetClientSecret(secret string) + func (p Discord) SetContext(ctx context.Context) + func (p Discord) SetRedirectUrl(url string) + func (p Discord) SetScopes(scopes []string) + func (p Discord) SetTokenUrl(url string) + func (p Discord) SetUserApiUrl(url string) + func (p Discord) TokenUrl() string + func (p Discord) UserApiUrl() string + type Facebook struct + func NewFacebookProvider() *Facebook + func (p *Facebook) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Facebook) AuthUrl() string + func (p Facebook) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Facebook) Client(token *oauth2.Token) *http.Client + func (p Facebook) ClientId() string + func (p Facebook) ClientSecret() string + func (p Facebook) Context() context.Context + func (p Facebook) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Facebook) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Facebook) RedirectUrl() string + func (p Facebook) Scopes() []string + func (p Facebook) SetAuthUrl(url string) + func (p Facebook) SetClientId(clientId string) + func (p Facebook) SetClientSecret(secret string) + func (p Facebook) SetContext(ctx context.Context) + func (p Facebook) SetRedirectUrl(url string) + func (p Facebook) SetScopes(scopes []string) + func (p Facebook) SetTokenUrl(url string) + func (p Facebook) SetUserApiUrl(url string) + func (p Facebook) TokenUrl() string + func (p Facebook) UserApiUrl() string + type Gitea struct + func NewGiteaProvider() *Gitea + func (p *Gitea) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Gitea) AuthUrl() string + func (p Gitea) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Gitea) Client(token *oauth2.Token) *http.Client + func (p Gitea) ClientId() string + func (p Gitea) ClientSecret() string + func (p Gitea) Context() context.Context + func (p Gitea) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Gitea) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Gitea) RedirectUrl() string + func (p Gitea) Scopes() []string + func (p Gitea) SetAuthUrl(url string) + func (p Gitea) SetClientId(clientId string) + func (p Gitea) SetClientSecret(secret string) + func (p Gitea) SetContext(ctx context.Context) + func (p Gitea) SetRedirectUrl(url string) + func (p Gitea) SetScopes(scopes []string) + func (p Gitea) SetTokenUrl(url string) + func (p Gitea) SetUserApiUrl(url string) + func (p Gitea) TokenUrl() string + func (p Gitea) UserApiUrl() string + type Gitee struct + func NewGiteeProvider() *Gitee + func (p *Gitee) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Gitee) AuthUrl() string + func (p Gitee) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Gitee) Client(token *oauth2.Token) *http.Client + func (p Gitee) ClientId() string + func (p Gitee) ClientSecret() string + func (p Gitee) Context() context.Context + func (p Gitee) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Gitee) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Gitee) RedirectUrl() string + func (p Gitee) Scopes() []string + func (p Gitee) SetAuthUrl(url string) + func (p Gitee) SetClientId(clientId string) + func (p Gitee) SetClientSecret(secret string) + func (p Gitee) SetContext(ctx context.Context) + func (p Gitee) SetRedirectUrl(url string) + func (p Gitee) SetScopes(scopes []string) + func (p Gitee) SetTokenUrl(url string) + func (p Gitee) SetUserApiUrl(url string) + func (p Gitee) TokenUrl() string + func (p Gitee) UserApiUrl() string + type Github struct + func NewGithubProvider() *Github + func (p *Github) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Github) AuthUrl() string + func (p Github) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Github) Client(token *oauth2.Token) *http.Client + func (p Github) ClientId() string + func (p Github) ClientSecret() string + func (p Github) Context() context.Context + func (p Github) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Github) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Github) RedirectUrl() string + func (p Github) Scopes() []string + func (p Github) SetAuthUrl(url string) + func (p Github) SetClientId(clientId string) + func (p Github) SetClientSecret(secret string) + func (p Github) SetContext(ctx context.Context) + func (p Github) SetRedirectUrl(url string) + func (p Github) SetScopes(scopes []string) + func (p Github) SetTokenUrl(url string) + func (p Github) SetUserApiUrl(url string) + func (p Github) TokenUrl() string + func (p Github) UserApiUrl() string + type Gitlab struct + func NewGitlabProvider() *Gitlab + func (p *Gitlab) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Gitlab) AuthUrl() string + func (p Gitlab) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Gitlab) Client(token *oauth2.Token) *http.Client + func (p Gitlab) ClientId() string + func (p Gitlab) ClientSecret() string + func (p Gitlab) Context() context.Context + func (p Gitlab) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Gitlab) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Gitlab) RedirectUrl() string + func (p Gitlab) Scopes() []string + func (p Gitlab) SetAuthUrl(url string) + func (p Gitlab) SetClientId(clientId string) + func (p Gitlab) SetClientSecret(secret string) + func (p Gitlab) SetContext(ctx context.Context) + func (p Gitlab) SetRedirectUrl(url string) + func (p Gitlab) SetScopes(scopes []string) + func (p Gitlab) SetTokenUrl(url string) + func (p Gitlab) SetUserApiUrl(url string) + func (p Gitlab) TokenUrl() string + func (p Gitlab) UserApiUrl() string + type Google struct + func NewGoogleProvider() *Google + func (p *Google) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Google) AuthUrl() string + func (p Google) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Google) Client(token *oauth2.Token) *http.Client + func (p Google) ClientId() string + func (p Google) ClientSecret() string + func (p Google) Context() context.Context + func (p Google) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Google) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Google) RedirectUrl() string + func (p Google) Scopes() []string + func (p Google) SetAuthUrl(url string) + func (p Google) SetClientId(clientId string) + func (p Google) SetClientSecret(secret string) + func (p Google) SetContext(ctx context.Context) + func (p Google) SetRedirectUrl(url string) + func (p Google) SetScopes(scopes []string) + func (p Google) SetTokenUrl(url string) + func (p Google) SetUserApiUrl(url string) + func (p Google) TokenUrl() string + func (p Google) UserApiUrl() string + type Kakao struct + func NewKakaoProvider() *Kakao + func (p *Kakao) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Kakao) AuthUrl() string + func (p Kakao) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Kakao) Client(token *oauth2.Token) *http.Client + func (p Kakao) ClientId() string + func (p Kakao) ClientSecret() string + func (p Kakao) Context() context.Context + func (p Kakao) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Kakao) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Kakao) RedirectUrl() string + func (p Kakao) Scopes() []string + func (p Kakao) SetAuthUrl(url string) + func (p Kakao) SetClientId(clientId string) + func (p Kakao) SetClientSecret(secret string) + func (p Kakao) SetContext(ctx context.Context) + func (p Kakao) SetRedirectUrl(url string) + func (p Kakao) SetScopes(scopes []string) + func (p Kakao) SetTokenUrl(url string) + func (p Kakao) SetUserApiUrl(url string) + func (p Kakao) TokenUrl() string + func (p Kakao) UserApiUrl() string + type Livechat struct + func NewLivechatProvider() *Livechat + func (p *Livechat) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Livechat) AuthUrl() string + func (p Livechat) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Livechat) Client(token *oauth2.Token) *http.Client + func (p Livechat) ClientId() string + func (p Livechat) ClientSecret() string + func (p Livechat) Context() context.Context + func (p Livechat) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Livechat) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Livechat) RedirectUrl() string + func (p Livechat) Scopes() []string + func (p Livechat) SetAuthUrl(url string) + func (p Livechat) SetClientId(clientId string) + func (p Livechat) SetClientSecret(secret string) + func (p Livechat) SetContext(ctx context.Context) + func (p Livechat) SetRedirectUrl(url string) + func (p Livechat) SetScopes(scopes []string) + func (p Livechat) SetTokenUrl(url string) + func (p Livechat) SetUserApiUrl(url string) + func (p Livechat) TokenUrl() string + func (p Livechat) UserApiUrl() string + type Microsoft struct + func NewMicrosoftProvider() *Microsoft + func (p *Microsoft) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Microsoft) AuthUrl() string + func (p Microsoft) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Microsoft) Client(token *oauth2.Token) *http.Client + func (p Microsoft) ClientId() string + func (p Microsoft) ClientSecret() string + func (p Microsoft) Context() context.Context + func (p Microsoft) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Microsoft) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Microsoft) RedirectUrl() string + func (p Microsoft) Scopes() []string + func (p Microsoft) SetAuthUrl(url string) + func (p Microsoft) SetClientId(clientId string) + func (p Microsoft) SetClientSecret(secret string) + func (p Microsoft) SetContext(ctx context.Context) + func (p Microsoft) SetRedirectUrl(url string) + func (p Microsoft) SetScopes(scopes []string) + func (p Microsoft) SetTokenUrl(url string) + func (p Microsoft) SetUserApiUrl(url string) + func (p Microsoft) TokenUrl() string + func (p Microsoft) UserApiUrl() string + type OIDC struct + func NewOIDCProvider() *OIDC + func (p *OIDC) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p OIDC) AuthUrl() string + func (p OIDC) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p OIDC) Client(token *oauth2.Token) *http.Client + func (p OIDC) ClientId() string + func (p OIDC) ClientSecret() string + func (p OIDC) Context() context.Context + func (p OIDC) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p OIDC) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p OIDC) RedirectUrl() string + func (p OIDC) Scopes() []string + func (p OIDC) SetAuthUrl(url string) + func (p OIDC) SetClientId(clientId string) + func (p OIDC) SetClientSecret(secret string) + func (p OIDC) SetContext(ctx context.Context) + func (p OIDC) SetRedirectUrl(url string) + func (p OIDC) SetScopes(scopes []string) + func (p OIDC) SetTokenUrl(url string) + func (p OIDC) SetUserApiUrl(url string) + func (p OIDC) TokenUrl() string + func (p OIDC) UserApiUrl() string + type Provider interface + AuthUrl func() string + BuildAuthUrl func(state string, opts ...oauth2.AuthCodeOption) string + Client func(token *oauth2.Token) *http.Client + ClientId func() string + ClientSecret func() string + Context func() context.Context + FetchAuthUser func(token *oauth2.Token) (user *AuthUser, err error) + FetchRawUserData func(token *oauth2.Token) ([]byte, error) + FetchToken func(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + RedirectUrl func() string + Scopes func() []string + SetAuthUrl func(url string) + SetClientId func(clientId string) + SetClientSecret func(secret string) + SetContext func(ctx context.Context) + SetRedirectUrl func(url string) + SetScopes func(scopes []string) + SetTokenUrl func(url string) + SetUserApiUrl func(url string) + TokenUrl func() string + UserApiUrl func() string + func NewProviderByName(name string) (Provider, error) + type Spotify struct + func NewSpotifyProvider() *Spotify + func (p *Spotify) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Spotify) AuthUrl() string + func (p Spotify) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Spotify) Client(token *oauth2.Token) *http.Client + func (p Spotify) ClientId() string + func (p Spotify) ClientSecret() string + func (p Spotify) Context() context.Context + func (p Spotify) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Spotify) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Spotify) RedirectUrl() string + func (p Spotify) Scopes() []string + func (p Spotify) SetAuthUrl(url string) + func (p Spotify) SetClientId(clientId string) + func (p Spotify) SetClientSecret(secret string) + func (p Spotify) SetContext(ctx context.Context) + func (p Spotify) SetRedirectUrl(url string) + func (p Spotify) SetScopes(scopes []string) + func (p Spotify) SetTokenUrl(url string) + func (p Spotify) SetUserApiUrl(url string) + func (p Spotify) TokenUrl() string + func (p Spotify) UserApiUrl() string + type Strava struct + func NewStravaProvider() *Strava + func (p *Strava) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Strava) AuthUrl() string + func (p Strava) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Strava) Client(token *oauth2.Token) *http.Client + func (p Strava) ClientId() string + func (p Strava) ClientSecret() string + func (p Strava) Context() context.Context + func (p Strava) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Strava) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Strava) RedirectUrl() string + func (p Strava) Scopes() []string + func (p Strava) SetAuthUrl(url string) + func (p Strava) SetClientId(clientId string) + func (p Strava) SetClientSecret(secret string) + func (p Strava) SetContext(ctx context.Context) + func (p Strava) SetRedirectUrl(url string) + func (p Strava) SetScopes(scopes []string) + func (p Strava) SetTokenUrl(url string) + func (p Strava) SetUserApiUrl(url string) + func (p Strava) TokenUrl() string + func (p Strava) UserApiUrl() string + type Twitch struct + func NewTwitchProvider() *Twitch + func (p *Twitch) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p *Twitch) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Twitch) AuthUrl() string + func (p Twitch) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Twitch) Client(token *oauth2.Token) *http.Client + func (p Twitch) ClientId() string + func (p Twitch) ClientSecret() string + func (p Twitch) Context() context.Context + func (p Twitch) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Twitch) RedirectUrl() string + func (p Twitch) Scopes() []string + func (p Twitch) SetAuthUrl(url string) + func (p Twitch) SetClientId(clientId string) + func (p Twitch) SetClientSecret(secret string) + func (p Twitch) SetContext(ctx context.Context) + func (p Twitch) SetRedirectUrl(url string) + func (p Twitch) SetScopes(scopes []string) + func (p Twitch) SetTokenUrl(url string) + func (p Twitch) SetUserApiUrl(url string) + func (p Twitch) TokenUrl() string + func (p Twitch) UserApiUrl() string + type Twitter struct + func NewTwitterProvider() *Twitter + func (p *Twitter) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) + func (p Twitter) AuthUrl() string + func (p Twitter) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string + func (p Twitter) Client(token *oauth2.Token) *http.Client + func (p Twitter) ClientId() string + func (p Twitter) ClientSecret() string + func (p Twitter) Context() context.Context + func (p Twitter) FetchRawUserData(token *oauth2.Token) ([]byte, error) + func (p Twitter) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) + func (p Twitter) RedirectUrl() string + func (p Twitter) Scopes() []string + func (p Twitter) SetAuthUrl(url string) + func (p Twitter) SetClientId(clientId string) + func (p Twitter) SetClientSecret(secret string) + func (p Twitter) SetContext(ctx context.Context) + func (p Twitter) SetRedirectUrl(url string) + func (p Twitter) SetScopes(scopes []string) + func (p Twitter) SetTokenUrl(url string) + func (p Twitter) SetUserApiUrl(url string) + func (p Twitter) TokenUrl() string + func (p Twitter) UserApiUrl() string