auth

package
v0.17.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 24 Imported by: 72

Documentation

Index

Constants

View Source
const NameApple string = "apple"

NameApple is the unique name of the Apple provider.

View Source
const NameDiscord string = "discord"

NameDiscord is the unique name of the Discord provider.

View Source
const NameFacebook string = "facebook"

NameFacebook is the unique name of the Facebook provider.

View Source
const NameGitea string = "gitea"

NameGitea is the unique name of the Gitea provider.

View Source
const NameGitee string = "gitee"

NameGitee is the unique name of the Gitee provider.

View Source
const NameGithub string = "github"

NameGithub is the unique name of the Github provider.

View Source
const NameGitlab string = "gitlab"

NameGitlab is the unique name of the Gitlab provider.

View Source
const NameGoogle string = "google"

NameGoogle is the unique name of the Google provider.

View Source
const NameInstagram string = "instagram"

NameInstagram is the unique name of the Instagram provider.

View Source
const NameKakao string = "kakao"

NameKakao is the unique name of the Kakao provider.

View Source
const NameLivechat = "livechat"

NameLivechat is the unique name of the Livechat provider.

View Source
const NameMicrosoft string = "microsoft"

NameMicrosoft is the unique name of the Microsoft provider.

View Source
const NameOIDC string = "oidc"

NameOIDC is the unique name of the OpenID Connect (OIDC) provider.

View Source
const NameSpotify string = "spotify"

NameSpotify is the unique name of the Spotify provider.

View Source
const NameStrava string = "strava"

NameStrava is the unique name of the Strava provider.

View Source
const NameTwitch string = "twitch"

NameTwitch is the unique name of the Twitch provider.

View Source
const NameTwitter string = "twitter"

NameTwitter is the unique name of the Twitter provider.

View Source
const NameVK string = "vk"

NameVK is the unique name of the VK provider.

View Source
const NameYandex string = "yandex"

NameYandex is the unique name of the Yandex provider.

Variables

This section is empty.

Functions

This section is empty.

Types

type Apple added in v0.14.0

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

Apple allows authentication via Apple OAuth2.

func NewAppleProvider added in v0.14.0

func NewAppleProvider() *Apple

NewAppleProvider creates a new Apple provider instance with some defaults.

func (Apple) AuthUrl added in v0.14.0

func (p Apple) AuthUrl() string

AuthUrl implements Provider.AuthUrl() interface method.

func (Apple) BuildAuthUrl added in v0.14.0

func (p Apple) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Apple) Client added in v0.14.0

func (p Apple) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Apple) ClientId added in v0.14.0

func (p Apple) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Apple) ClientSecret added in v0.14.0

func (p Apple) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Apple) Context added in v0.14.0

func (p Apple) Context() context.Context

Context implements Provider.Context() interface method.

func (*Apple) FetchAuthUser added in v0.14.0

func (p *Apple) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

FetchAuthUser returns an AuthUser instance based on the provided token.

API reference: https://developer.apple.com/documentation/sign_in_with_apple/tokenresponse.

func (*Apple) FetchRawUserData added in v0.14.0

func (p *Apple) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData interface.

Apple doesn't have a UserInfo endpoint and claims about users are instead included in the "id_token" (https://openid.net/specs/openid-connect-core-1_0.html#id_tokenExample)

func (Apple) FetchToken added in v0.14.0

func (p Apple) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Apple) RedirectUrl added in v0.14.0

func (p Apple) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Apple) Scopes added in v0.14.0

func (p Apple) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Apple) SetAuthUrl added in v0.14.0

func (p Apple) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Apple) SetClientId added in v0.14.0

func (p Apple) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Apple) SetClientSecret added in v0.14.0

func (p Apple) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Apple) SetContext added in v0.14.0

func (p Apple) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Apple) SetRedirectUrl added in v0.14.0

func (p Apple) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Apple) SetScopes added in v0.14.0

func (p Apple) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Apple) SetTokenUrl added in v0.14.0

func (p Apple) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Apple) SetUserApiUrl added in v0.14.0

func (p Apple) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Apple) TokenUrl added in v0.14.0

func (p Apple) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Apple) UserApiUrl added in v0.14.0

func (p Apple) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Discord) BuildAuthUrl added in v0.6.0

func (p Discord) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Discord) Client added in v0.6.0

func (p Discord) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Discord) ClientId added in v0.6.0

func (p Discord) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Discord) ClientSecret added in v0.6.0

func (p Discord) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Discord) Context added in v0.14.0

func (p Discord) Context() context.Context

Context implements Provider.Context() interface method.

func (*Discord) FetchAuthUser added in v0.6.0

func (p *Discord) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Discord) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Discord) FetchToken added in v0.6.0

func (p Discord) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Discord) RedirectUrl added in v0.6.0

func (p Discord) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Discord) Scopes added in v0.6.0

func (p Discord) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Discord) SetAuthUrl added in v0.6.0

func (p Discord) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Discord) SetClientId added in v0.6.0

func (p Discord) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Discord) SetClientSecret added in v0.6.0

func (p Discord) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Discord) SetContext added in v0.14.0

func (p Discord) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Discord) SetRedirectUrl added in v0.6.0

func (p Discord) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Discord) SetScopes added in v0.6.0

func (p Discord) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Discord) SetTokenUrl added in v0.6.0

func (p Discord) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Discord) SetUserApiUrl added in v0.6.0

func (p Discord) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Discord) TokenUrl added in v0.6.0

func (p Discord) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Discord) UserApiUrl added in v0.6.0

func (p Discord) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Facebook) BuildAuthUrl

func (p Facebook) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Facebook) Client

func (p Facebook) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Facebook) ClientId

func (p Facebook) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Facebook) ClientSecret

func (p Facebook) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Facebook) Context added in v0.14.0

func (p Facebook) Context() context.Context

Context implements Provider.Context() interface method.

func (*Facebook) FetchAuthUser

func (p *Facebook) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Facebook) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Facebook) FetchToken

func (p Facebook) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Facebook) RedirectUrl

func (p Facebook) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Facebook) Scopes

func (p Facebook) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Facebook) SetAuthUrl

func (p Facebook) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Facebook) SetClientId

func (p Facebook) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Facebook) SetClientSecret

func (p Facebook) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Facebook) SetContext added in v0.14.0

func (p Facebook) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Facebook) SetRedirectUrl

func (p Facebook) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Facebook) SetScopes

func (p Facebook) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Facebook) SetTokenUrl

func (p Facebook) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Facebook) SetUserApiUrl

func (p Facebook) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Facebook) TokenUrl

func (p Facebook) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Facebook) UserApiUrl

func (p Facebook) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Gitea) BuildAuthUrl added in v0.12.0

func (p Gitea) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Gitea) Client added in v0.12.0

func (p Gitea) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Gitea) ClientId added in v0.12.0

func (p Gitea) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Gitea) ClientSecret added in v0.12.0

func (p Gitea) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Gitea) Context added in v0.14.0

func (p Gitea) Context() context.Context

Context implements Provider.Context() interface method.

func (*Gitea) FetchAuthUser added in v0.12.0

func (p *Gitea) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Gitea) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Gitea) FetchToken added in v0.12.0

func (p Gitea) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Gitea) RedirectUrl added in v0.12.0

func (p Gitea) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Gitea) Scopes added in v0.12.0

func (p Gitea) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Gitea) SetAuthUrl added in v0.12.0

func (p Gitea) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Gitea) SetClientId added in v0.12.0

func (p Gitea) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Gitea) SetClientSecret added in v0.12.0

func (p Gitea) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Gitea) SetContext added in v0.14.0

func (p Gitea) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Gitea) SetRedirectUrl added in v0.12.0

func (p Gitea) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Gitea) SetScopes added in v0.12.0

func (p Gitea) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Gitea) SetTokenUrl added in v0.12.0

func (p Gitea) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Gitea) SetUserApiUrl added in v0.12.0

func (p Gitea) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Gitea) TokenUrl added in v0.12.0

func (p Gitea) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Gitea) UserApiUrl added in v0.12.0

func (p Gitea) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Gitee) BuildAuthUrl added in v0.11.0

func (p Gitee) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Gitee) Client added in v0.11.0

func (p Gitee) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Gitee) ClientId added in v0.11.0

func (p Gitee) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Gitee) ClientSecret added in v0.11.0

func (p Gitee) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Gitee) Context added in v0.14.0

func (p Gitee) Context() context.Context

Context implements Provider.Context() interface method.

func (*Gitee) FetchAuthUser added in v0.11.0

func (p *Gitee) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Gitee) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Gitee) FetchToken added in v0.11.0

func (p Gitee) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Gitee) RedirectUrl added in v0.11.0

func (p Gitee) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Gitee) Scopes added in v0.11.0

func (p Gitee) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Gitee) SetAuthUrl added in v0.11.0

func (p Gitee) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Gitee) SetClientId added in v0.11.0

func (p Gitee) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Gitee) SetClientSecret added in v0.11.0

func (p Gitee) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Gitee) SetContext added in v0.14.0

func (p Gitee) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Gitee) SetRedirectUrl added in v0.11.0

func (p Gitee) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Gitee) SetScopes added in v0.11.0

func (p Gitee) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Gitee) SetTokenUrl added in v0.11.0

func (p Gitee) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Gitee) SetUserApiUrl added in v0.11.0

func (p Gitee) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Gitee) TokenUrl added in v0.11.0

func (p Gitee) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Gitee) UserApiUrl added in v0.11.0

func (p Gitee) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Github) BuildAuthUrl

func (p Github) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Github) Client

func (p Github) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Github) ClientId

func (p Github) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Github) ClientSecret

func (p Github) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Github) Context added in v0.14.0

func (p Github) Context() context.Context

Context implements Provider.Context() interface method.

func (*Github) FetchAuthUser

func (p *Github) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Github) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Github) FetchToken

func (p Github) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Github) RedirectUrl

func (p Github) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Github) Scopes

func (p Github) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Github) SetAuthUrl

func (p Github) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Github) SetClientId

func (p Github) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Github) SetClientSecret

func (p Github) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Github) SetContext added in v0.14.0

func (p Github) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Github) SetRedirectUrl

func (p Github) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Github) SetScopes

func (p Github) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Github) SetTokenUrl

func (p Github) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Github) SetUserApiUrl

func (p Github) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Github) TokenUrl

func (p Github) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Github) UserApiUrl

func (p Github) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Gitlab) BuildAuthUrl

func (p Gitlab) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Gitlab) Client

func (p Gitlab) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Gitlab) ClientId

func (p Gitlab) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Gitlab) ClientSecret

func (p Gitlab) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Gitlab) Context added in v0.14.0

func (p Gitlab) Context() context.Context

Context implements Provider.Context() interface method.

func (*Gitlab) FetchAuthUser

func (p *Gitlab) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Gitlab) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Gitlab) FetchToken

func (p Gitlab) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Gitlab) RedirectUrl

func (p Gitlab) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Gitlab) Scopes

func (p Gitlab) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Gitlab) SetAuthUrl

func (p Gitlab) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Gitlab) SetClientId

func (p Gitlab) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Gitlab) SetClientSecret

func (p Gitlab) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Gitlab) SetContext added in v0.14.0

func (p Gitlab) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Gitlab) SetRedirectUrl

func (p Gitlab) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Gitlab) SetScopes

func (p Gitlab) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Gitlab) SetTokenUrl

func (p Gitlab) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Gitlab) SetUserApiUrl

func (p Gitlab) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Gitlab) TokenUrl

func (p Gitlab) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Gitlab) UserApiUrl

func (p Gitlab) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Google) BuildAuthUrl

func (p Google) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Google) Client

func (p Google) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Google) ClientId

func (p Google) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Google) ClientSecret

func (p Google) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Google) Context added in v0.14.0

func (p Google) Context() context.Context

Context implements Provider.Context() interface method.

func (*Google) FetchAuthUser

func (p *Google) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

FetchAuthUser returns an AuthUser instance based the Google's user api.

func (Google) FetchRawUserData

func (p Google) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Google) FetchToken

func (p Google) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Google) RedirectUrl

func (p Google) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Google) Scopes

func (p Google) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Google) SetAuthUrl

func (p Google) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Google) SetClientId

func (p Google) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Google) SetClientSecret

func (p Google) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Google) SetContext added in v0.14.0

func (p Google) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Google) SetRedirectUrl

func (p Google) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Google) SetScopes

func (p Google) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Google) SetTokenUrl

func (p Google) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Google) SetUserApiUrl

func (p Google) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Google) TokenUrl

func (p Google) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Google) UserApiUrl

func (p Google) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

type Instagram added in v0.17.0

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

Instagram allows authentication via Instagram OAuth2.

func NewInstagramProvider added in v0.17.0

func NewInstagramProvider() *Instagram

NewInstagramProvider creates new Instagram provider instance with some defaults.

func (Instagram) AuthUrl added in v0.17.0

func (p Instagram) AuthUrl() string

AuthUrl implements Provider.AuthUrl() interface method.

func (Instagram) BuildAuthUrl added in v0.17.0

func (p Instagram) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Instagram) Client added in v0.17.0

func (p Instagram) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Instagram) ClientId added in v0.17.0

func (p Instagram) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Instagram) ClientSecret added in v0.17.0

func (p Instagram) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Instagram) Context added in v0.17.0

func (p Instagram) Context() context.Context

Context implements Provider.Context() interface method.

func (*Instagram) FetchAuthUser added in v0.17.0

func (p *Instagram) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

FetchAuthUser returns an AuthUser instance based on the Instagram's user api.

API reference: https://developers.facebook.com/docs/instagram-basic-display-api/reference/user#fields

func (Instagram) FetchRawUserData added in v0.17.0

func (p Instagram) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Instagram) FetchToken added in v0.17.0

func (p Instagram) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Instagram) RedirectUrl added in v0.17.0

func (p Instagram) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Instagram) Scopes added in v0.17.0

func (p Instagram) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Instagram) SetAuthUrl added in v0.17.0

func (p Instagram) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Instagram) SetClientId added in v0.17.0

func (p Instagram) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Instagram) SetClientSecret added in v0.17.0

func (p Instagram) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Instagram) SetContext added in v0.17.0

func (p Instagram) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Instagram) SetRedirectUrl added in v0.17.0

func (p Instagram) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Instagram) SetScopes added in v0.17.0

func (p Instagram) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Instagram) SetTokenUrl added in v0.17.0

func (p Instagram) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Instagram) SetUserApiUrl added in v0.17.0

func (p Instagram) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Instagram) TokenUrl added in v0.17.0

func (p Instagram) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Instagram) UserApiUrl added in v0.17.0

func (p Instagram) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Kakao) BuildAuthUrl added in v0.8.0

func (p Kakao) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Kakao) Client added in v0.8.0

func (p Kakao) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Kakao) ClientId added in v0.8.0

func (p Kakao) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Kakao) ClientSecret added in v0.8.0

func (p Kakao) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Kakao) Context added in v0.14.0

func (p Kakao) Context() context.Context

Context implements Provider.Context() interface method.

func (*Kakao) FetchAuthUser added in v0.8.0

func (p *Kakao) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Kakao) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Kakao) FetchToken added in v0.8.0

func (p Kakao) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Kakao) RedirectUrl added in v0.8.0

func (p Kakao) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Kakao) Scopes added in v0.8.0

func (p Kakao) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Kakao) SetAuthUrl added in v0.8.0

func (p Kakao) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Kakao) SetClientId added in v0.8.0

func (p Kakao) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Kakao) SetClientSecret added in v0.8.0

func (p Kakao) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Kakao) SetContext added in v0.14.0

func (p Kakao) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Kakao) SetRedirectUrl added in v0.8.0

func (p Kakao) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Kakao) SetScopes added in v0.8.0

func (p Kakao) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Kakao) SetTokenUrl added in v0.8.0

func (p Kakao) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Kakao) SetUserApiUrl added in v0.8.0

func (p Kakao) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Kakao) TokenUrl added in v0.8.0

func (p Kakao) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Kakao) UserApiUrl added in v0.8.0

func (p Kakao) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Livechat) BuildAuthUrl added in v0.12.0

func (p Livechat) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Livechat) Client added in v0.12.0

func (p Livechat) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Livechat) ClientId added in v0.12.0

func (p Livechat) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Livechat) ClientSecret added in v0.12.0

func (p Livechat) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Livechat) Context added in v0.14.0

func (p Livechat) Context() context.Context

Context implements Provider.Context() interface method.

func (*Livechat) FetchAuthUser added in v0.12.0

func (p *Livechat) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Livechat) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Livechat) FetchToken added in v0.12.0

func (p Livechat) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Livechat) RedirectUrl added in v0.12.0

func (p Livechat) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Livechat) Scopes added in v0.12.0

func (p Livechat) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Livechat) SetAuthUrl added in v0.12.0

func (p Livechat) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Livechat) SetClientId added in v0.12.0

func (p Livechat) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Livechat) SetClientSecret added in v0.12.0

func (p Livechat) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Livechat) SetContext added in v0.14.0

func (p Livechat) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Livechat) SetRedirectUrl added in v0.12.0

func (p Livechat) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Livechat) SetScopes added in v0.12.0

func (p Livechat) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Livechat) SetTokenUrl added in v0.12.0

func (p Livechat) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Livechat) SetUserApiUrl added in v0.12.0

func (p Livechat) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Livechat) TokenUrl added in v0.12.0

func (p Livechat) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Livechat) UserApiUrl added in v0.12.0

func (p Livechat) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Microsoft) BuildAuthUrl added in v0.8.0

func (p Microsoft) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Microsoft) Client added in v0.8.0

func (p Microsoft) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Microsoft) ClientId added in v0.8.0

func (p Microsoft) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Microsoft) ClientSecret added in v0.8.0

func (p Microsoft) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Microsoft) Context added in v0.14.0

func (p Microsoft) Context() context.Context

Context implements Provider.Context() interface method.

func (*Microsoft) FetchAuthUser added in v0.8.0

func (p *Microsoft) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Microsoft) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Microsoft) FetchToken added in v0.8.0

func (p Microsoft) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Microsoft) RedirectUrl added in v0.8.0

func (p Microsoft) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Microsoft) Scopes added in v0.8.0

func (p Microsoft) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Microsoft) SetAuthUrl added in v0.8.0

func (p Microsoft) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Microsoft) SetClientId added in v0.8.0

func (p Microsoft) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Microsoft) SetClientSecret added in v0.8.0

func (p Microsoft) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Microsoft) SetContext added in v0.14.0

func (p Microsoft) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Microsoft) SetRedirectUrl added in v0.8.0

func (p Microsoft) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Microsoft) SetScopes added in v0.8.0

func (p Microsoft) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Microsoft) SetTokenUrl added in v0.8.0

func (p Microsoft) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Microsoft) SetUserApiUrl added in v0.8.0

func (p Microsoft) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Microsoft) TokenUrl added in v0.8.0

func (p Microsoft) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Microsoft) UserApiUrl added in v0.8.0

func (p Microsoft) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (OIDC) BuildAuthUrl added in v0.13.0

func (p OIDC) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (OIDC) Client added in v0.13.0

func (p OIDC) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (OIDC) ClientId added in v0.13.0

func (p OIDC) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (OIDC) ClientSecret added in v0.13.0

func (p OIDC) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (OIDC) Context added in v0.14.0

func (p OIDC) Context() context.Context

Context implements Provider.Context() interface method.

func (*OIDC) FetchAuthUser added in v0.13.0

func (p *OIDC) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p OIDC) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (OIDC) FetchToken added in v0.13.0

func (p OIDC) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (OIDC) RedirectUrl added in v0.13.0

func (p OIDC) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (OIDC) Scopes added in v0.13.0

func (p OIDC) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (OIDC) SetAuthUrl added in v0.13.0

func (p OIDC) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (OIDC) SetClientId added in v0.13.0

func (p OIDC) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (OIDC) SetClientSecret added in v0.13.0

func (p OIDC) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (OIDC) SetContext added in v0.14.0

func (p OIDC) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (OIDC) SetRedirectUrl added in v0.13.0

func (p OIDC) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (OIDC) SetScopes added in v0.13.0

func (p OIDC) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (OIDC) SetTokenUrl added in v0.13.0

func (p OIDC) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (OIDC) SetUserApiUrl added in v0.13.0

func (p OIDC) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (OIDC) TokenUrl added in v0.13.0

func (p OIDC) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (OIDC) UserApiUrl added in v0.13.0

func (p OIDC) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

type Provider

type Provider interface {
	// Scopes returns the context associated with the provider (if any).
	Context() context.Context

	// SetContext assigns the specified context to the current provider.
	SetContext(ctx context.Context)

	// 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

func NewProviderByName(name string) (Provider, error)

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 method.

func (Spotify) BuildAuthUrl added in v0.8.0

func (p Spotify) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Spotify) Client added in v0.8.0

func (p Spotify) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Spotify) ClientId added in v0.8.0

func (p Spotify) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Spotify) ClientSecret added in v0.8.0

func (p Spotify) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Spotify) Context added in v0.14.0

func (p Spotify) Context() context.Context

Context implements Provider.Context() interface method.

func (*Spotify) FetchAuthUser added in v0.8.0

func (p *Spotify) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Spotify) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Spotify) FetchToken added in v0.8.0

func (p Spotify) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Spotify) RedirectUrl added in v0.8.0

func (p Spotify) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Spotify) Scopes added in v0.8.0

func (p Spotify) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Spotify) SetAuthUrl added in v0.8.0

func (p Spotify) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Spotify) SetClientId added in v0.8.0

func (p Spotify) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Spotify) SetClientSecret added in v0.8.0

func (p Spotify) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Spotify) SetContext added in v0.14.0

func (p Spotify) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Spotify) SetRedirectUrl added in v0.8.0

func (p Spotify) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Spotify) SetScopes added in v0.8.0

func (p Spotify) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Spotify) SetTokenUrl added in v0.8.0

func (p Spotify) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Spotify) SetUserApiUrl added in v0.8.0

func (p Spotify) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Spotify) TokenUrl added in v0.8.0

func (p Spotify) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Spotify) UserApiUrl added in v0.8.0

func (p Spotify) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Strava) BuildAuthUrl added in v0.11.0

func (p Strava) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Strava) Client added in v0.11.0

func (p Strava) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Strava) ClientId added in v0.11.0

func (p Strava) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Strava) ClientSecret added in v0.11.0

func (p Strava) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Strava) Context added in v0.14.0

func (p Strava) Context() context.Context

Context implements Provider.Context() interface method.

func (*Strava) FetchAuthUser added in v0.11.0

func (p *Strava) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Strava) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Strava) FetchToken added in v0.11.0

func (p Strava) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Strava) RedirectUrl added in v0.11.0

func (p Strava) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Strava) Scopes added in v0.11.0

func (p Strava) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Strava) SetAuthUrl added in v0.11.0

func (p Strava) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Strava) SetClientId added in v0.11.0

func (p Strava) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Strava) SetClientSecret added in v0.11.0

func (p Strava) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Strava) SetContext added in v0.14.0

func (p Strava) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Strava) SetRedirectUrl added in v0.11.0

func (p Strava) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Strava) SetScopes added in v0.11.0

func (p Strava) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Strava) SetTokenUrl added in v0.11.0

func (p Strava) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Strava) SetUserApiUrl added in v0.11.0

func (p Strava) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Strava) TokenUrl added in v0.11.0

func (p Strava) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Strava) UserApiUrl added in v0.11.0

func (p Strava) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Twitch) BuildAuthUrl added in v0.8.0

func (p Twitch) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Twitch) Client added in v0.8.0

func (p Twitch) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Twitch) ClientId added in v0.8.0

func (p Twitch) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Twitch) ClientSecret added in v0.8.0

func (p Twitch) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Twitch) Context added in v0.14.0

func (p Twitch) Context() context.Context

Context implements Provider.Context() interface method.

func (*Twitch) FetchAuthUser added in v0.8.0

func (p *Twitch) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p *Twitch) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData interface.

This differ from baseProvider because Twitch requires the `Client-Id` header.

func (Twitch) FetchToken added in v0.8.0

func (p Twitch) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Twitch) RedirectUrl added in v0.8.0

func (p Twitch) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Twitch) Scopes added in v0.8.0

func (p Twitch) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Twitch) SetAuthUrl added in v0.8.0

func (p Twitch) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Twitch) SetClientId added in v0.8.0

func (p Twitch) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Twitch) SetClientSecret added in v0.8.0

func (p Twitch) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Twitch) SetContext added in v0.14.0

func (p Twitch) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Twitch) SetRedirectUrl added in v0.8.0

func (p Twitch) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Twitch) SetScopes added in v0.8.0

func (p Twitch) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Twitch) SetTokenUrl added in v0.8.0

func (p Twitch) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Twitch) SetUserApiUrl added in v0.8.0

func (p Twitch) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Twitch) TokenUrl added in v0.8.0

func (p Twitch) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Twitch) UserApiUrl added in v0.8.0

func (p Twitch) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

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 method.

func (Twitter) BuildAuthUrl added in v0.6.0

func (p Twitter) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Twitter) Client added in v0.6.0

func (p Twitter) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Twitter) ClientId added in v0.6.0

func (p Twitter) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Twitter) ClientSecret added in v0.6.0

func (p Twitter) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Twitter) Context added in v0.14.0

func (p Twitter) Context() context.Context

Context implements Provider.Context() interface method.

func (*Twitter) FetchAuthUser added in v0.6.0

func (p *Twitter) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

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

func (p Twitter) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Twitter) FetchToken added in v0.6.0

func (p Twitter) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Twitter) RedirectUrl added in v0.6.0

func (p Twitter) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Twitter) Scopes added in v0.6.0

func (p Twitter) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Twitter) SetAuthUrl added in v0.6.0

func (p Twitter) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Twitter) SetClientId added in v0.6.0

func (p Twitter) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Twitter) SetClientSecret added in v0.6.0

func (p Twitter) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Twitter) SetContext added in v0.14.0

func (p Twitter) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Twitter) SetRedirectUrl added in v0.6.0

func (p Twitter) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Twitter) SetScopes added in v0.6.0

func (p Twitter) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Twitter) SetTokenUrl added in v0.6.0

func (p Twitter) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Twitter) SetUserApiUrl added in v0.6.0

func (p Twitter) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Twitter) TokenUrl added in v0.6.0

func (p Twitter) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Twitter) UserApiUrl added in v0.6.0

func (p Twitter) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

type VK added in v0.17.0

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

VK allows authentication via VK OAuth2.

func NewVKProvider added in v0.17.0

func NewVKProvider() *VK

NewVKProvider creates new VK provider instance with some defaults.

Docs: https://dev.vk.com/api/oauth-parameters

func (VK) AuthUrl added in v0.17.0

func (p VK) AuthUrl() string

AuthUrl implements Provider.AuthUrl() interface method.

func (VK) BuildAuthUrl added in v0.17.0

func (p VK) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (VK) Client added in v0.17.0

func (p VK) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (VK) ClientId added in v0.17.0

func (p VK) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (VK) ClientSecret added in v0.17.0

func (p VK) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (VK) Context added in v0.17.0

func (p VK) Context() context.Context

Context implements Provider.Context() interface method.

func (*VK) FetchAuthUser added in v0.17.0

func (p *VK) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

FetchAuthUser returns an AuthUser instance based on VK's user api.

API reference: https://dev.vk.com/method/users.get

func (VK) FetchRawUserData added in v0.17.0

func (p VK) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (VK) FetchToken added in v0.17.0

func (p VK) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (VK) RedirectUrl added in v0.17.0

func (p VK) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (VK) Scopes added in v0.17.0

func (p VK) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (VK) SetAuthUrl added in v0.17.0

func (p VK) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (VK) SetClientId added in v0.17.0

func (p VK) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (VK) SetClientSecret added in v0.17.0

func (p VK) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (VK) SetContext added in v0.17.0

func (p VK) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (VK) SetRedirectUrl added in v0.17.0

func (p VK) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (VK) SetScopes added in v0.17.0

func (p VK) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (VK) SetTokenUrl added in v0.17.0

func (p VK) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (VK) SetUserApiUrl added in v0.17.0

func (p VK) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (VK) TokenUrl added in v0.17.0

func (p VK) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (VK) UserApiUrl added in v0.17.0

func (p VK) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

type Yandex added in v0.17.0

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

Yandex allows authentication via Yandex OAuth2.

func NewYandexProvider added in v0.17.0

func NewYandexProvider() *Yandex

NewYandexProvider creates new Yandex provider instance with some defaults.

Docs: https://yandex.ru/dev/id/doc/en/

func (Yandex) AuthUrl added in v0.17.0

func (p Yandex) AuthUrl() string

AuthUrl implements Provider.AuthUrl() interface method.

func (Yandex) BuildAuthUrl added in v0.17.0

func (p Yandex) BuildAuthUrl(state string, opts ...oauth2.AuthCodeOption) string

BuildAuthUrl implements Provider.BuildAuthUrl() interface method.

func (Yandex) Client added in v0.17.0

func (p Yandex) Client(token *oauth2.Token) *http.Client

Client implements Provider.Client() interface method.

func (Yandex) ClientId added in v0.17.0

func (p Yandex) ClientId() string

ClientId implements Provider.ClientId() interface method.

func (Yandex) ClientSecret added in v0.17.0

func (p Yandex) ClientSecret() string

ClientSecret implements Provider.ClientSecret() interface method.

func (Yandex) Context added in v0.17.0

func (p Yandex) Context() context.Context

Context implements Provider.Context() interface method.

func (*Yandex) FetchAuthUser added in v0.17.0

func (p *Yandex) FetchAuthUser(token *oauth2.Token) (*AuthUser, error)

FetchAuthUser returns an AuthUser instance based on Yandex's user api.

API reference: https://yandex.ru/dev/id/doc/en/user-information#response-format

func (Yandex) FetchRawUserData added in v0.17.0

func (p Yandex) FetchRawUserData(token *oauth2.Token) ([]byte, error)

FetchRawUserData implements Provider.FetchRawUserData() interface method.

func (Yandex) FetchToken added in v0.17.0

func (p Yandex) FetchToken(code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

FetchToken implements Provider.FetchToken() interface method.

func (Yandex) RedirectUrl added in v0.17.0

func (p Yandex) RedirectUrl() string

RedirectUrl implements Provider.RedirectUrl() interface method.

func (Yandex) Scopes added in v0.17.0

func (p Yandex) Scopes() []string

Scopes implements Provider.Scopes() interface method.

func (Yandex) SetAuthUrl added in v0.17.0

func (p Yandex) SetAuthUrl(url string)

SetAuthUrl implements Provider.SetAuthUrl() interface method.

func (Yandex) SetClientId added in v0.17.0

func (p Yandex) SetClientId(clientId string)

SetClientId implements Provider.SetClientId() interface method.

func (Yandex) SetClientSecret added in v0.17.0

func (p Yandex) SetClientSecret(secret string)

SetClientSecret implements Provider.SetClientSecret() interface method.

func (Yandex) SetContext added in v0.17.0

func (p Yandex) SetContext(ctx context.Context)

SetContext implements Provider.SetContext() interface method.

func (Yandex) SetRedirectUrl added in v0.17.0

func (p Yandex) SetRedirectUrl(url string)

SetRedirectUrl implements Provider.SetRedirectUrl() interface method.

func (Yandex) SetScopes added in v0.17.0

func (p Yandex) SetScopes(scopes []string)

SetScopes implements Provider.SetScopes() interface method.

func (Yandex) SetTokenUrl added in v0.17.0

func (p Yandex) SetTokenUrl(url string)

SetTokenUrl implements Provider.SetTokenUrl() interface method.

func (Yandex) SetUserApiUrl added in v0.17.0

func (p Yandex) SetUserApiUrl(url string)

SetUserApiUrl implements Provider.SetUserApiUrl() interface method.

func (Yandex) TokenUrl added in v0.17.0

func (p Yandex) TokenUrl() string

TokenUrl implements Provider.TokenUrl() interface method.

func (Yandex) UserApiUrl added in v0.17.0

func (p Yandex) UserApiUrl() string

UserApiUrl implements Provider.UserApiUrl() interface method.

Jump to

Keyboard shortcuts

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