Documentation
¶
Index ¶
- Variables
- type GitHubOAuth
- func (g GitHubOAuth) GetRedirectURL(req *RedirectURIRequest) string
- func (g GitHubOAuth) GetScope() (ScopeName, ScopeValue)
- func (g GitHubOAuth) GetToken(ctx context.Context, req *TokenRequest) (*http.Response, error)
- func (g GitHubOAuth) GetUserInfo(ctx context.Context, response TokenResponse) (*UserInfoResponse, error)
- func (g GitHubOAuth) Prepare(_ context.Context, _ *PrepareRequest) error
- type GoogleOAuth
- func (g GoogleOAuth) GetRedirectURL(req *RedirectURIRequest) string
- func (g GoogleOAuth) GetScope() (ScopeName, ScopeValue)
- func (g GoogleOAuth) GetToken(ctx context.Context, req *TokenRequest) (*http.Response, error)
- func (g GoogleOAuth) GetUserInfo(ctx context.Context, response TokenResponse) (*UserInfoResponse, error)
- func (g GoogleOAuth) Prepare(_ context.Context, _ *PrepareRequest) error
- type GrantType
- type OIDCOAuth
- func (o *OIDCOAuth) GetRedirectURL(req *RedirectURIRequest) string
- func (o *OIDCOAuth) GetScope() (ScopeName, ScopeValue)
- func (o *OIDCOAuth) GetToken(ctx context.Context, req *TokenRequest) (*http.Response, error)
- func (o *OIDCOAuth) GetUserInfo(ctx context.Context, response TokenResponse) (*UserInfoResponse, error)
- func (o *OIDCOAuth) Prepare(ctx context.Context, req *PrepareRequest) error
- type PrepareRequest
- type RedirectURIRequest
- type ResponseType
- type ScopeName
- type ScopeValue
- type TokenRequest
- type TokenResponse
- type UserInfoResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var Providers = map[string]oauthProvider{ "github": GitHubOAuth{ AuthURL: "https://github.com/login/oauth/authorize", TokenURL: "https://github.com/login/oauth/access_token", }, "google": GoogleOAuth{ AuthURL: "https://accounts.google.com/o/oauth2/auth", TokenURL: "https://accounts.google.com/o/oauth2/token", }, "oidc": &OIDCOAuth{}, }
Functions ¶
This section is empty.
Types ¶
type GitHubOAuth ¶
func (GitHubOAuth) GetRedirectURL ¶
func (g GitHubOAuth) GetRedirectURL(req *RedirectURIRequest) string
func (GitHubOAuth) GetScope ¶
func (g GitHubOAuth) GetScope() (ScopeName, ScopeValue)
func (GitHubOAuth) GetToken ¶ added in v0.5.0
func (g GitHubOAuth) GetToken(ctx context.Context, req *TokenRequest) (*http.Response, error)
func (GitHubOAuth) GetUserInfo ¶ added in v0.5.0
func (g GitHubOAuth) GetUserInfo(ctx context.Context, response TokenResponse) (*UserInfoResponse, error)
func (GitHubOAuth) Prepare ¶ added in v0.4.0
func (g GitHubOAuth) Prepare(_ context.Context, _ *PrepareRequest) error
type GoogleOAuth ¶
func (GoogleOAuth) GetRedirectURL ¶
func (g GoogleOAuth) GetRedirectURL(req *RedirectURIRequest) string
func (GoogleOAuth) GetScope ¶
func (g GoogleOAuth) GetScope() (ScopeName, ScopeValue)
func (GoogleOAuth) GetToken ¶ added in v0.5.0
func (g GoogleOAuth) GetToken(ctx context.Context, req *TokenRequest) (*http.Response, error)
func (GoogleOAuth) GetUserInfo ¶ added in v0.5.0
func (g GoogleOAuth) GetUserInfo(ctx context.Context, response TokenResponse) (*UserInfoResponse, error)
func (GoogleOAuth) Prepare ¶ added in v0.4.0
func (g GoogleOAuth) Prepare(_ context.Context, _ *PrepareRequest) error
type OIDCOAuth ¶ added in v0.4.0
type OIDCOAuth struct {
AuthURL string `json:"authorization_endpoint"`
TokenURL string `json:"token_endpoint"`
UserInfoURL string `json:"userinfo_endpoint"`
Scopes []ScopeValue `json:"scopes_supported"`
ResponseType []ResponseType `json:"response_types_supported"`
GrantType []GrantType `json:"grant_types_supported"`
ConfigurationURL string
}
func (*OIDCOAuth) GetRedirectURL ¶ added in v0.4.0
func (o *OIDCOAuth) GetRedirectURL(req *RedirectURIRequest) string
func (*OIDCOAuth) GetScope ¶ added in v0.4.0
func (o *OIDCOAuth) GetScope() (ScopeName, ScopeValue)
func (*OIDCOAuth) GetUserInfo ¶ added in v0.5.0
func (o *OIDCOAuth) GetUserInfo(ctx context.Context, response TokenResponse) (*UserInfoResponse, error)
type PrepareRequest ¶ added in v0.5.0
type PrepareRequest struct {
// contains filtered or unexported fields
}
func NewPrepareRequest ¶ added in v0.5.0
func NewPrepareRequest(cURL string) *PrepareRequest
type RedirectURIRequest ¶ added in v0.5.0
type RedirectURIRequest struct {
// contains filtered or unexported fields
}
func NewRedirectURIRequest ¶ added in v0.5.0
func NewRedirectURIRequest(clientID string, redirectURI string) *RedirectURIRequest
type ResponseType ¶ added in v0.4.0
type ResponseType string
func (ResponseType) String ¶ added in v0.4.0
func (rt ResponseType) String() string
type ScopeValue ¶ added in v0.4.0
type ScopeValue string
func (ScopeValue) String ¶ added in v0.4.0
func (sv ScopeValue) String() string
type TokenRequest ¶ added in v0.5.0
type TokenRequest struct {
// contains filtered or unexported fields
}
func NewTokenRequest ¶ added in v0.5.0
func NewTokenRequest(clientID string, clientSecret string, code string, redirectURI string) *TokenRequest
type TokenResponse ¶ added in v0.5.0
type TokenResponse []byte
type UserInfoResponse ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.