Documentation
¶
Index ¶
- func NewGithubOAuth2Provider(config *settings.Config, redirectUrl string) (provider.OAuth2Provider, error)
- type GithubOAuth2Provider
- func (p *GithubOAuth2Provider) GetOAuth2AuthUrl(c core.Context, state string, opts ...oauth2.AuthCodeOption) (string, error)
- func (p *GithubOAuth2Provider) GetOAuth2Token(c core.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
- func (p *GithubOAuth2Provider) GetUserInfo(c core.Context, oauth2Token *oauth2.Token) (*data.OAuth2UserInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGithubOAuth2Provider ¶
func NewGithubOAuth2Provider(config *settings.Config, redirectUrl string) (provider.OAuth2Provider, error)
NewGithubOAuth2Provider creates a new Github OAuth 2.0 provider instance
Types ¶
type GithubOAuth2Provider ¶
type GithubOAuth2Provider struct {
provider.OAuth2Provider
// contains filtered or unexported fields
}
GithubOAuth2Provider represents Github OAuth 2.0 provider
func (*GithubOAuth2Provider) GetOAuth2AuthUrl ¶
func (p *GithubOAuth2Provider) GetOAuth2AuthUrl(c core.Context, state string, opts ...oauth2.AuthCodeOption) (string, error)
GetOAuth2AuthUrl returns the authentication url of the GitHub OAuth 2.0 provider
func (*GithubOAuth2Provider) GetOAuth2Token ¶
func (p *GithubOAuth2Provider) GetOAuth2Token(c core.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
GetOAuth2Token returns the OAuth 2.0 token of the GitHub OAuth 2.0 provider
func (*GithubOAuth2Provider) GetUserInfo ¶
func (p *GithubOAuth2Provider) GetUserInfo(c core.Context, oauth2Token *oauth2.Token) (*data.OAuth2UserInfo, error)
GetUserInfo returns the user info by the Github OAuth 2.0 provider
Click to show internal directories.
Click to hide internal directories.