Documentation ¶
Index ¶
- Constants
- type AuthUser
- type Discord
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- type Spotify
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- func (p *Twitch) FetchRawUserData(token *oauth2.Token) ([]byte, error)
- 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) 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
- 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) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)
- 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) 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
Constants ¶
const NameDiscord string = "discord"
NameDiscord is the unique name of the Discord provider.
const NameFacebook string = "facebook"
NameFacebook is the unique name of the Facebook provider.
const NameGitea string = "gitea"
NameGitea is the unique name of the Gitea provider.
const NameGitee string = "gitee"
NameGitee is the unique name of the Gitee provider.
const NameGithub string = "github"
NameGithub is the unique name of the Github provider.
const NameGitlab string = "gitlab"
NameGitlab is the unique name of the Gitlab provider.
const NameGoogle string = "google"
NameGoogle is the unique name of the Google provider.
const NameKakao string = "kakao"
NameKakao is the unique name of the Kakao provider.
const NameLivechat = "livechat"
NameLivechat is the unique name of the Livechat provider.
const NameMicrosoft string = "microsoft"
NameMicrosoft is the unique name of the Microsoft provider.
const NameOIDC string = "oidc"
NameOIDC is the unique name of the OpenID Connect (OIDC) provider.
const NameSpotify string = "spotify"
NameSpotify is the unique name of the Spotify provider.
const NameStrava string = "strava"
NameStrava is the unique name of the Strava provider.
const NameTwitch string = "twitch"
NameTwitch is the unique name of the Twitch provider.
const NameTwitter string = "twitter"
NameTwitter is the unique name of the Twitter provider.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthUser ¶
type AuthUser struct { Id string `json:"id"` Name string `json:"name"` Username string `json:"username"` Email string `json:"email"` AvatarUrl string `json:"avatarUrl"` RawUser map[string]any `json:"rawUser"` AccessToken string `json:"accessToken"` RefreshToken string `json:"refreshToken"` }
AuthUser defines a standardized oauth2 user data structure.
type Discord ¶ added in v0.6.0
type Discord struct {
// contains filtered or unexported fields
}
Discord allows authentication via Discord OAuth2.
func NewDiscordProvider ¶ added in v0.6.0
func NewDiscordProvider() *Discord
NewDiscordProvider creates a new Discord provider instance with some defaults.
func (Discord) AuthUrl ¶ added in v0.6.0
func (p Discord) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Discord) BuildAuthUrl ¶ added in v0.6.0
func (p Discord) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Discord) ClientId ¶ added in v0.6.0
func (p Discord) ClientId() string
ClientId implements Provider.ClientId interface.
func (Discord) ClientSecret ¶ added in v0.6.0
func (p Discord) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Discord) FetchAuthUser ¶ added in v0.6.0
FetchAuthUser returns an AuthUser instance from Discord's user api.
API reference: https://discord.com/developers/docs/resources/user#user-object
func (Discord) FetchRawUserData ¶ added in v0.6.0
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Discord) FetchToken ¶ added in v0.6.0
FetchToken implements Provider.FetchToken interface.
func (Discord) RedirectUrl ¶ added in v0.6.0
func (p Discord) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Discord) Scopes ¶ added in v0.6.0
func (p Discord) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Discord) SetAuthUrl ¶ added in v0.6.0
func (p Discord) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Discord) SetClientId ¶ added in v0.6.0
func (p Discord) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Discord) SetClientSecret ¶ added in v0.6.0
func (p Discord) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Discord) SetRedirectUrl ¶ added in v0.6.0
func (p Discord) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Discord) SetScopes ¶ added in v0.6.0
func (p Discord) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Discord) SetTokenUrl ¶ added in v0.6.0
func (p Discord) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Discord) SetUserApiUrl ¶ added in v0.6.0
func (p Discord) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Discord) TokenUrl ¶ added in v0.6.0
func (p Discord) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Discord) UserApiUrl ¶ added in v0.6.0
func (p Discord) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Facebook ¶
type Facebook struct {
// contains filtered or unexported fields
}
Facebook allows authentication via Facebook OAuth2.
func NewFacebookProvider ¶
func NewFacebookProvider() *Facebook
NewFacebookProvider creates new Facebook provider instance with some defaults.
func (Facebook) AuthUrl ¶
func (p Facebook) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Facebook) BuildAuthUrl ¶
func (p Facebook) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Facebook) ClientId ¶
func (p Facebook) ClientId() string
ClientId implements Provider.ClientId interface.
func (Facebook) ClientSecret ¶
func (p Facebook) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Facebook) FetchAuthUser ¶
FetchAuthUser returns an AuthUser instance based on the Facebook's user api.
API reference: https://developers.facebook.com/docs/graph-api/reference/user/
func (Facebook) FetchRawUserData ¶
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Facebook) FetchToken ¶
FetchToken implements Provider.FetchToken interface.
func (Facebook) RedirectUrl ¶
func (p Facebook) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Facebook) Scopes ¶
func (p Facebook) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Facebook) SetAuthUrl ¶
func (p Facebook) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Facebook) SetClientId ¶
func (p Facebook) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Facebook) SetClientSecret ¶
func (p Facebook) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Facebook) SetRedirectUrl ¶
func (p Facebook) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Facebook) SetScopes ¶
func (p Facebook) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Facebook) SetTokenUrl ¶
func (p Facebook) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Facebook) SetUserApiUrl ¶
func (p Facebook) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Facebook) TokenUrl ¶
func (p Facebook) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Facebook) UserApiUrl ¶
func (p Facebook) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Gitea ¶ added in v0.12.0
type Gitea struct {
// contains filtered or unexported fields
}
Gitea allows authentication via Gitea OAuth2.
func NewGiteaProvider ¶ added in v0.12.0
func NewGiteaProvider() *Gitea
NewGiteaProvider creates new Gitea provider instance with some defaults.
func (Gitea) AuthUrl ¶ added in v0.12.0
func (p Gitea) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Gitea) BuildAuthUrl ¶ added in v0.12.0
func (p Gitea) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Gitea) ClientId ¶ added in v0.12.0
func (p Gitea) ClientId() string
ClientId implements Provider.ClientId interface.
func (Gitea) ClientSecret ¶ added in v0.12.0
func (p Gitea) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Gitea) FetchAuthUser ¶ added in v0.12.0
FetchAuthUser returns an AuthUser instance based on Gitea's user api.
API reference: https://try.gitea.io/api/swagger#/user/userGetCurrent
func (Gitea) FetchRawUserData ¶ added in v0.12.0
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Gitea) FetchToken ¶ added in v0.12.0
FetchToken implements Provider.FetchToken interface.
func (Gitea) RedirectUrl ¶ added in v0.12.0
func (p Gitea) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Gitea) Scopes ¶ added in v0.12.0
func (p Gitea) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Gitea) SetAuthUrl ¶ added in v0.12.0
func (p Gitea) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Gitea) SetClientId ¶ added in v0.12.0
func (p Gitea) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Gitea) SetClientSecret ¶ added in v0.12.0
func (p Gitea) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Gitea) SetRedirectUrl ¶ added in v0.12.0
func (p Gitea) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Gitea) SetScopes ¶ added in v0.12.0
func (p Gitea) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Gitea) SetTokenUrl ¶ added in v0.12.0
func (p Gitea) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Gitea) SetUserApiUrl ¶ added in v0.12.0
func (p Gitea) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Gitea) TokenUrl ¶ added in v0.12.0
func (p Gitea) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Gitea) UserApiUrl ¶ added in v0.12.0
func (p Gitea) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Gitee ¶ added in v0.11.0
type Gitee struct {
// contains filtered or unexported fields
}
Gitee allows authentication via Gitee OAuth2.
func NewGiteeProvider ¶ added in v0.11.0
func NewGiteeProvider() *Gitee
NewGiteeProvider creates new Gitee provider instance with some defaults.
func (Gitee) AuthUrl ¶ added in v0.11.0
func (p Gitee) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Gitee) BuildAuthUrl ¶ added in v0.11.0
func (p Gitee) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Gitee) ClientId ¶ added in v0.11.0
func (p Gitee) ClientId() string
ClientId implements Provider.ClientId interface.
func (Gitee) ClientSecret ¶ added in v0.11.0
func (p Gitee) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Gitee) FetchAuthUser ¶ added in v0.11.0
FetchAuthUser returns an AuthUser instance based the Gitee's user api.
API reference: https://gitee.com/api/v5/swagger#/getV5User
func (Gitee) FetchRawUserData ¶ added in v0.11.0
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Gitee) FetchToken ¶ added in v0.11.0
FetchToken implements Provider.FetchToken interface.
func (Gitee) RedirectUrl ¶ added in v0.11.0
func (p Gitee) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Gitee) Scopes ¶ added in v0.11.0
func (p Gitee) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Gitee) SetAuthUrl ¶ added in v0.11.0
func (p Gitee) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Gitee) SetClientId ¶ added in v0.11.0
func (p Gitee) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Gitee) SetClientSecret ¶ added in v0.11.0
func (p Gitee) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Gitee) SetRedirectUrl ¶ added in v0.11.0
func (p Gitee) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Gitee) SetScopes ¶ added in v0.11.0
func (p Gitee) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Gitee) SetTokenUrl ¶ added in v0.11.0
func (p Gitee) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Gitee) SetUserApiUrl ¶ added in v0.11.0
func (p Gitee) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Gitee) TokenUrl ¶ added in v0.11.0
func (p Gitee) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Gitee) UserApiUrl ¶ added in v0.11.0
func (p Gitee) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Github ¶
type Github struct {
// contains filtered or unexported fields
}
Github allows authentication via Github OAuth2.
func NewGithubProvider ¶
func NewGithubProvider() *Github
NewGithubProvider creates new Github provider instance with some defaults.
func (Github) AuthUrl ¶
func (p Github) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Github) BuildAuthUrl ¶
func (p Github) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Github) ClientId ¶
func (p Github) ClientId() string
ClientId implements Provider.ClientId interface.
func (Github) ClientSecret ¶
func (p Github) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Github) FetchAuthUser ¶
FetchAuthUser returns an AuthUser instance based the Github's user api.
API reference: https://docs.github.com/en/rest/reference/users#get-the-authenticated-user
func (Github) FetchRawUserData ¶
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Github) FetchToken ¶
FetchToken implements Provider.FetchToken interface.
func (Github) RedirectUrl ¶
func (p Github) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Github) Scopes ¶
func (p Github) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Github) SetAuthUrl ¶
func (p Github) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Github) SetClientId ¶
func (p Github) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Github) SetClientSecret ¶
func (p Github) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Github) SetRedirectUrl ¶
func (p Github) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Github) SetScopes ¶
func (p Github) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Github) SetTokenUrl ¶
func (p Github) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Github) SetUserApiUrl ¶
func (p Github) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Github) TokenUrl ¶
func (p Github) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Github) UserApiUrl ¶
func (p Github) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Gitlab ¶
type Gitlab struct {
// contains filtered or unexported fields
}
Gitlab allows authentication via Gitlab OAuth2.
func NewGitlabProvider ¶
func NewGitlabProvider() *Gitlab
NewGitlabProvider creates new Gitlab provider instance with some defaults.
func (Gitlab) AuthUrl ¶
func (p Gitlab) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Gitlab) BuildAuthUrl ¶
func (p Gitlab) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Gitlab) ClientId ¶
func (p Gitlab) ClientId() string
ClientId implements Provider.ClientId interface.
func (Gitlab) ClientSecret ¶
func (p Gitlab) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Gitlab) FetchAuthUser ¶
FetchAuthUser returns an AuthUser instance based the Gitlab's user api.
API reference: https://docs.gitlab.com/ee/api/users.html#for-admin
func (Gitlab) FetchRawUserData ¶
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Gitlab) FetchToken ¶
FetchToken implements Provider.FetchToken interface.
func (Gitlab) RedirectUrl ¶
func (p Gitlab) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Gitlab) Scopes ¶
func (p Gitlab) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Gitlab) SetAuthUrl ¶
func (p Gitlab) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Gitlab) SetClientId ¶
func (p Gitlab) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Gitlab) SetClientSecret ¶
func (p Gitlab) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Gitlab) SetRedirectUrl ¶
func (p Gitlab) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Gitlab) SetScopes ¶
func (p Gitlab) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Gitlab) SetTokenUrl ¶
func (p Gitlab) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Gitlab) SetUserApiUrl ¶
func (p Gitlab) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Gitlab) TokenUrl ¶
func (p Gitlab) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Gitlab) UserApiUrl ¶
func (p Gitlab) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Google ¶
type Google struct {
// contains filtered or unexported fields
}
Google allows authentication via Google OAuth2.
func NewGoogleProvider ¶
func NewGoogleProvider() *Google
NewGoogleProvider creates new Google provider instance with some defaults.
func (Google) AuthUrl ¶
func (p Google) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Google) BuildAuthUrl ¶
func (p Google) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Google) ClientId ¶
func (p Google) ClientId() string
ClientId implements Provider.ClientId interface.
func (Google) ClientSecret ¶
func (p Google) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Google) FetchAuthUser ¶
FetchAuthUser returns an AuthUser instance based the Google's user api.
func (Google) FetchRawUserData ¶
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Google) FetchToken ¶
FetchToken implements Provider.FetchToken interface.
func (Google) RedirectUrl ¶
func (p Google) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Google) Scopes ¶
func (p Google) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Google) SetAuthUrl ¶
func (p Google) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Google) SetClientId ¶
func (p Google) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Google) SetClientSecret ¶
func (p Google) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Google) SetRedirectUrl ¶
func (p Google) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Google) SetScopes ¶
func (p Google) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Google) SetTokenUrl ¶
func (p Google) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Google) SetUserApiUrl ¶
func (p Google) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Google) TokenUrl ¶
func (p Google) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Google) UserApiUrl ¶
func (p Google) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Kakao ¶ added in v0.8.0
type Kakao struct {
// contains filtered or unexported fields
}
Kakao allows authentication via Kakao OAuth2.
func NewKakaoProvider ¶ added in v0.8.0
func NewKakaoProvider() *Kakao
NewKakaoProvider creates a new Kakao provider instance with some defaults.
func (Kakao) AuthUrl ¶ added in v0.8.0
func (p Kakao) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Kakao) BuildAuthUrl ¶ added in v0.8.0
func (p Kakao) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Kakao) ClientId ¶ added in v0.8.0
func (p Kakao) ClientId() string
ClientId implements Provider.ClientId interface.
func (Kakao) ClientSecret ¶ added in v0.8.0
func (p Kakao) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Kakao) FetchAuthUser ¶ added in v0.8.0
FetchAuthUser returns an AuthUser instance based on the Kakao's user api.
API reference: https://developers.kakao.com/docs/latest/en/kakaologin/rest-api#req-user-info-response
func (Kakao) FetchRawUserData ¶ added in v0.8.0
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Kakao) FetchToken ¶ added in v0.8.0
FetchToken implements Provider.FetchToken interface.
func (Kakao) RedirectUrl ¶ added in v0.8.0
func (p Kakao) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Kakao) Scopes ¶ added in v0.8.0
func (p Kakao) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Kakao) SetAuthUrl ¶ added in v0.8.0
func (p Kakao) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Kakao) SetClientId ¶ added in v0.8.0
func (p Kakao) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Kakao) SetClientSecret ¶ added in v0.8.0
func (p Kakao) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Kakao) SetRedirectUrl ¶ added in v0.8.0
func (p Kakao) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Kakao) SetScopes ¶ added in v0.8.0
func (p Kakao) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Kakao) SetTokenUrl ¶ added in v0.8.0
func (p Kakao) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Kakao) SetUserApiUrl ¶ added in v0.8.0
func (p Kakao) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Kakao) TokenUrl ¶ added in v0.8.0
func (p Kakao) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Kakao) UserApiUrl ¶ added in v0.8.0
func (p Kakao) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Livechat ¶ added in v0.12.0
type Livechat struct {
// contains filtered or unexported fields
}
Livechat allows authentication via Livechat OAuth2.
func NewLivechatProvider ¶ added in v0.12.0
func NewLivechatProvider() *Livechat
NewLivechatProvider creates new Livechat provider instance with some defaults.
func (Livechat) AuthUrl ¶ added in v0.12.0
func (p Livechat) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Livechat) BuildAuthUrl ¶ added in v0.12.0
func (p Livechat) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Livechat) ClientId ¶ added in v0.12.0
func (p Livechat) ClientId() string
ClientId implements Provider.ClientId interface.
func (Livechat) ClientSecret ¶ added in v0.12.0
func (p Livechat) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Livechat) FetchAuthUser ¶ added in v0.12.0
FetchAuthUser returns an AuthUser based on the Livechat accounts API.
API reference: https://developers.livechat.com/docs/authorization
func (Livechat) FetchRawUserData ¶ added in v0.12.0
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Livechat) FetchToken ¶ added in v0.12.0
FetchToken implements Provider.FetchToken interface.
func (Livechat) RedirectUrl ¶ added in v0.12.0
func (p Livechat) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Livechat) Scopes ¶ added in v0.12.0
func (p Livechat) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Livechat) SetAuthUrl ¶ added in v0.12.0
func (p Livechat) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Livechat) SetClientId ¶ added in v0.12.0
func (p Livechat) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Livechat) SetClientSecret ¶ added in v0.12.0
func (p Livechat) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Livechat) SetRedirectUrl ¶ added in v0.12.0
func (p Livechat) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Livechat) SetScopes ¶ added in v0.12.0
func (p Livechat) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Livechat) SetTokenUrl ¶ added in v0.12.0
func (p Livechat) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Livechat) SetUserApiUrl ¶ added in v0.12.0
func (p Livechat) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Livechat) TokenUrl ¶ added in v0.12.0
func (p Livechat) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Livechat) UserApiUrl ¶ added in v0.12.0
func (p Livechat) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Microsoft ¶ added in v0.8.0
type Microsoft struct {
// contains filtered or unexported fields
}
Microsoft allows authentication via AzureADEndpoint OAuth2.
func NewMicrosoftProvider ¶ added in v0.8.0
func NewMicrosoftProvider() *Microsoft
NewMicrosoftProvider creates new Microsoft AD provider instance with some defaults.
func (Microsoft) AuthUrl ¶ added in v0.8.0
func (p Microsoft) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Microsoft) BuildAuthUrl ¶ added in v0.8.0
func (p Microsoft) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Microsoft) ClientId ¶ added in v0.8.0
func (p Microsoft) ClientId() string
ClientId implements Provider.ClientId interface.
func (Microsoft) ClientSecret ¶ added in v0.8.0
func (p Microsoft) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Microsoft) FetchAuthUser ¶ added in v0.8.0
FetchAuthUser returns an AuthUser instance based on the Microsoft's user api.
API reference: https://learn.microsoft.com/en-us/azure/active-directory/develop/userinfo Graph explorer: https://developer.microsoft.com/en-us/graph/graph-explorer
func (Microsoft) FetchRawUserData ¶ added in v0.8.0
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Microsoft) FetchToken ¶ added in v0.8.0
FetchToken implements Provider.FetchToken interface.
func (Microsoft) RedirectUrl ¶ added in v0.8.0
func (p Microsoft) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Microsoft) Scopes ¶ added in v0.8.0
func (p Microsoft) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Microsoft) SetAuthUrl ¶ added in v0.8.0
func (p Microsoft) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Microsoft) SetClientId ¶ added in v0.8.0
func (p Microsoft) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Microsoft) SetClientSecret ¶ added in v0.8.0
func (p Microsoft) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Microsoft) SetRedirectUrl ¶ added in v0.8.0
func (p Microsoft) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Microsoft) SetScopes ¶ added in v0.8.0
func (p Microsoft) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Microsoft) SetTokenUrl ¶ added in v0.8.0
func (p Microsoft) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Microsoft) SetUserApiUrl ¶ added in v0.8.0
func (p Microsoft) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Microsoft) TokenUrl ¶ added in v0.8.0
func (p Microsoft) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Microsoft) UserApiUrl ¶ added in v0.8.0
func (p Microsoft) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type OIDC ¶ added in v0.13.0
type OIDC struct {
// contains filtered or unexported fields
}
OIDC allows authentication via OpenID Connect (OIDC) OAuth2 provider.
func NewOIDCProvider ¶ added in v0.13.0
func NewOIDCProvider() *OIDC
NewOIDCProvider creates new OpenID Connect (OIDC) provider instance with some defaults.
func (OIDC) AuthUrl ¶ added in v0.13.0
func (p OIDC) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (OIDC) BuildAuthUrl ¶ added in v0.13.0
func (p OIDC) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (OIDC) ClientId ¶ added in v0.13.0
func (p OIDC) ClientId() string
ClientId implements Provider.ClientId interface.
func (OIDC) ClientSecret ¶ added in v0.13.0
func (p OIDC) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*OIDC) FetchAuthUser ¶ added in v0.13.0
FetchAuthUser returns an AuthUser instance based the provider's user api.
API reference: https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
func (OIDC) FetchRawUserData ¶ added in v0.13.0
FetchRawUserData implements Provider.FetchRawUserData interface.
func (OIDC) FetchToken ¶ added in v0.13.0
FetchToken implements Provider.FetchToken interface.
func (OIDC) RedirectUrl ¶ added in v0.13.0
func (p OIDC) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (OIDC) Scopes ¶ added in v0.13.0
func (p OIDC) Scopes() []string
Scopes implements Provider.Scopes interface.
func (OIDC) SetAuthUrl ¶ added in v0.13.0
func (p OIDC) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (OIDC) SetClientId ¶ added in v0.13.0
func (p OIDC) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (OIDC) SetClientSecret ¶ added in v0.13.0
func (p OIDC) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (OIDC) SetRedirectUrl ¶ added in v0.13.0
func (p OIDC) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (OIDC) SetScopes ¶ added in v0.13.0
func (p OIDC) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (OIDC) SetTokenUrl ¶ added in v0.13.0
func (p OIDC) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (OIDC) SetUserApiUrl ¶ added in v0.13.0
func (p OIDC) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (OIDC) TokenUrl ¶ added in v0.13.0
func (p OIDC) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (OIDC) UserApiUrl ¶ added in v0.13.0
func (p OIDC) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Provider ¶
type Provider interface { // Scopes returns the provider access permissions that will be requested. Scopes() []string // SetScopes sets the provider access permissions that will be requested later. SetScopes(scopes []string) // ClientId returns the provider client's app ID. ClientId() string // SetClientId sets the provider client's ID. SetClientId(clientId string) // ClientSecret returns the provider client's app secret. ClientSecret() string // SetClientSecret sets the provider client's app secret. SetClientSecret(secret string) // RedirectUrl returns the end address to redirect the user // going through the OAuth flow. RedirectUrl() string // SetRedirectUrl sets the provider's RedirectUrl. SetRedirectUrl(url string) // AuthUrl returns the provider's authorization service url. AuthUrl() string // SetAuthUrl sets the provider's AuthUrl. SetAuthUrl(url string) // TokenUrl returns the provider's token exchange service url. TokenUrl() string // SetTokenUrl sets the provider's TokenUrl. SetTokenUrl(url string) // UserApiUrl returns the provider's user info api url. UserApiUrl() string // SetUserApiUrl sets the provider's UserApiUrl. SetUserApiUrl(url string) // Client returns an http client using the provided token. Client(token *oauth2.Token) *http.Client // BuildAuthUrl returns a URL to the provider's consent page // that asks for permissions for the required scopes explicitly. BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string // FetchToken converts an authorization code to token. FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) // FetchRawUserData requests and marshalizes into `result` the // the OAuth user api response. FetchRawUserData(token *oauth2.Token) ([]byte, error) // FetchAuthUser is similar to FetchRawUserData, but normalizes and // marshalizes the user api response into a standardized AuthUser struct. FetchAuthUser(token *oauth2.Token) (user *AuthUser, err error) }
Provider defines a common interface for an OAuth2 client.
func NewProviderByName ¶
NewProviderByName returns a new preconfigured provider instance by its name identifier.
type Spotify ¶ added in v0.8.0
type Spotify struct {
// contains filtered or unexported fields
}
Spotify allows authentication via Spotify OAuth2.
func NewSpotifyProvider ¶ added in v0.8.0
func NewSpotifyProvider() *Spotify
NewSpotifyProvider creates a new Spotify provider instance with some defaults.
func (Spotify) AuthUrl ¶ added in v0.8.0
func (p Spotify) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Spotify) BuildAuthUrl ¶ added in v0.8.0
func (p Spotify) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Spotify) ClientId ¶ added in v0.8.0
func (p Spotify) ClientId() string
ClientId implements Provider.ClientId interface.
func (Spotify) ClientSecret ¶ added in v0.8.0
func (p Spotify) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Spotify) FetchAuthUser ¶ added in v0.8.0
FetchAuthUser returns an AuthUser instance based on the Spotify's user api.
API reference: https://developer.spotify.com/documentation/web-api/reference/#/operations/get-current-users-profile
func (Spotify) FetchRawUserData ¶ added in v0.8.0
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Spotify) FetchToken ¶ added in v0.8.0
FetchToken implements Provider.FetchToken interface.
func (Spotify) RedirectUrl ¶ added in v0.8.0
func (p Spotify) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Spotify) Scopes ¶ added in v0.8.0
func (p Spotify) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Spotify) SetAuthUrl ¶ added in v0.8.0
func (p Spotify) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Spotify) SetClientId ¶ added in v0.8.0
func (p Spotify) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Spotify) SetClientSecret ¶ added in v0.8.0
func (p Spotify) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Spotify) SetRedirectUrl ¶ added in v0.8.0
func (p Spotify) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Spotify) SetScopes ¶ added in v0.8.0
func (p Spotify) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Spotify) SetTokenUrl ¶ added in v0.8.0
func (p Spotify) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Spotify) SetUserApiUrl ¶ added in v0.8.0
func (p Spotify) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Spotify) TokenUrl ¶ added in v0.8.0
func (p Spotify) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Spotify) UserApiUrl ¶ added in v0.8.0
func (p Spotify) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Strava ¶ added in v0.11.0
type Strava struct {
// contains filtered or unexported fields
}
Strava allows authentication via Strava OAuth2.
func NewStravaProvider ¶ added in v0.11.0
func NewStravaProvider() *Strava
NewStravaProvider creates new Strava provider instance with some defaults.
func (Strava) AuthUrl ¶ added in v0.11.0
func (p Strava) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Strava) BuildAuthUrl ¶ added in v0.11.0
func (p Strava) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Strava) ClientId ¶ added in v0.11.0
func (p Strava) ClientId() string
ClientId implements Provider.ClientId interface.
func (Strava) ClientSecret ¶ added in v0.11.0
func (p Strava) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Strava) FetchAuthUser ¶ added in v0.11.0
FetchAuthUser returns an AuthUser instance based on the Strava's user api.
API reference: https://developers.strava.com/docs/authentication/
func (Strava) FetchRawUserData ¶ added in v0.11.0
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Strava) FetchToken ¶ added in v0.11.0
FetchToken implements Provider.FetchToken interface.
func (Strava) RedirectUrl ¶ added in v0.11.0
func (p Strava) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Strava) Scopes ¶ added in v0.11.0
func (p Strava) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Strava) SetAuthUrl ¶ added in v0.11.0
func (p Strava) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Strava) SetClientId ¶ added in v0.11.0
func (p Strava) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Strava) SetClientSecret ¶ added in v0.11.0
func (p Strava) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Strava) SetRedirectUrl ¶ added in v0.11.0
func (p Strava) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Strava) SetScopes ¶ added in v0.11.0
func (p Strava) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Strava) SetTokenUrl ¶ added in v0.11.0
func (p Strava) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Strava) SetUserApiUrl ¶ added in v0.11.0
func (p Strava) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Strava) TokenUrl ¶ added in v0.11.0
func (p Strava) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Strava) UserApiUrl ¶ added in v0.11.0
func (p Strava) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Twitch ¶ added in v0.8.0
type Twitch struct {
// contains filtered or unexported fields
}
Twitch allows authentication via Twitch OAuth2.
func NewTwitchProvider ¶ added in v0.8.0
func NewTwitchProvider() *Twitch
NewTwitchProvider creates new Twitch provider instance with some defaults.
func (Twitch) AuthUrl ¶ added in v0.8.0
func (p Twitch) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Twitch) BuildAuthUrl ¶ added in v0.8.0
func (p Twitch) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Twitch) ClientId ¶ added in v0.8.0
func (p Twitch) ClientId() string
ClientId implements Provider.ClientId interface.
func (Twitch) ClientSecret ¶ added in v0.8.0
func (p Twitch) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Twitch) FetchAuthUser ¶ added in v0.8.0
FetchAuthUser returns an AuthUser instance based the Twitch's user api.
API reference: https://dev.twitch.tv/docs/api/reference#get-users
func (*Twitch) FetchRawUserData ¶ added in v0.8.0
FetchRawUserData implements Provider.FetchRawUserData interface.
This differ from baseProvider because Twitch requires the `Client-Id` header.
func (Twitch) FetchToken ¶ added in v0.8.0
FetchToken implements Provider.FetchToken interface.
func (Twitch) RedirectUrl ¶ added in v0.8.0
func (p Twitch) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Twitch) Scopes ¶ added in v0.8.0
func (p Twitch) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Twitch) SetAuthUrl ¶ added in v0.8.0
func (p Twitch) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Twitch) SetClientId ¶ added in v0.8.0
func (p Twitch) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Twitch) SetClientSecret ¶ added in v0.8.0
func (p Twitch) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Twitch) SetRedirectUrl ¶ added in v0.8.0
func (p Twitch) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Twitch) SetScopes ¶ added in v0.8.0
func (p Twitch) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Twitch) SetTokenUrl ¶ added in v0.8.0
func (p Twitch) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Twitch) SetUserApiUrl ¶ added in v0.8.0
func (p Twitch) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Twitch) TokenUrl ¶ added in v0.8.0
func (p Twitch) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Twitch) UserApiUrl ¶ added in v0.8.0
func (p Twitch) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.
type Twitter ¶ added in v0.6.0
type Twitter struct {
// contains filtered or unexported fields
}
Twitter allows authentication via Twitter OAuth2.
func NewTwitterProvider ¶ added in v0.6.0
func NewTwitterProvider() *Twitter
NewTwitterProvider creates new Twitter provider instance with some defaults.
func (Twitter) AuthUrl ¶ added in v0.6.0
func (p Twitter) AuthUrl() string
AuthUrl implements Provider.AuthUrl interface.
func (Twitter) BuildAuthUrl ¶ added in v0.6.0
func (p Twitter) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string
BuildAuthUrl implements Provider.BuildAuthUrl interface.
func (Twitter) ClientId ¶ added in v0.6.0
func (p Twitter) ClientId() string
ClientId implements Provider.ClientId interface.
func (Twitter) ClientSecret ¶ added in v0.6.0
func (p Twitter) ClientSecret() string
ClientSecret implements Provider.ClientSecret interface.
func (*Twitter) FetchAuthUser ¶ added in v0.6.0
FetchAuthUser returns an AuthUser instance based on the Twitter's user api.
API reference: https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me
func (Twitter) FetchRawUserData ¶ added in v0.6.0
FetchRawUserData implements Provider.FetchRawUserData interface.
func (Twitter) FetchToken ¶ added in v0.6.0
FetchToken implements Provider.FetchToken interface.
func (Twitter) RedirectUrl ¶ added in v0.6.0
func (p Twitter) RedirectUrl() string
RedirectUrl implements Provider.RedirectUrl interface.
func (Twitter) Scopes ¶ added in v0.6.0
func (p Twitter) Scopes() []string
Scopes implements Provider.Scopes interface.
func (Twitter) SetAuthUrl ¶ added in v0.6.0
func (p Twitter) SetAuthUrl(url string)
SetAuthUrl implements Provider.SetAuthUrl interface.
func (Twitter) SetClientId ¶ added in v0.6.0
func (p Twitter) SetClientId(clientId string)
SetClientId implements Provider.SetClientId interface.
func (Twitter) SetClientSecret ¶ added in v0.6.0
func (p Twitter) SetClientSecret(secret string)
SetClientSecret implements Provider.SetClientSecret interface.
func (Twitter) SetRedirectUrl ¶ added in v0.6.0
func (p Twitter) SetRedirectUrl(url string)
SetRedirectUrl implements Provider.SetRedirectUrl interface.
func (Twitter) SetScopes ¶ added in v0.6.0
func (p Twitter) SetScopes(scopes []string)
SetScopes implements Provider.SetScopes interface.
func (Twitter) SetTokenUrl ¶ added in v0.6.0
func (p Twitter) SetTokenUrl(url string)
SetTokenUrl implements Provider.SetTokenUrl interface.
func (Twitter) SetUserApiUrl ¶ added in v0.6.0
func (p Twitter) SetUserApiUrl(url string)
SetUserApiUrl implements Provider.SetUserApiUrl interface.
func (Twitter) TokenUrl ¶ added in v0.6.0
func (p Twitter) TokenUrl() string
TokenUrl implements Provider.TokenUrl interface.
func (Twitter) UserApiUrl ¶ added in v0.6.0
func (p Twitter) UserApiUrl() string
UserApiUrl implements Provider.UserApiUrl interface.