Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct { Client *oauth2.Config Config *Config // contains filtered or unexported fields }
func (*Component) OauthCode ¶
func (c *Component) OauthCode(w http.ResponseWriter, r *http.Request) (*OauthToken, error)
OauthCode 获取code Handler
func (*Component) OauthLogin ¶
func (c *Component) OauthLogin(w http.ResponseWriter, r *http.Request, req OauthLoginParams)
OauthLogin 登录Handler
type Config ¶
type Config struct { ClientID string ClientSecret string AuthURL string TokenURL string RedirectURL string UserInfoURL string OauthStateCookieName string }
Config oauth2配置
type Container ¶
type Container struct { Config *Config // contains filtered or unexported fields }
func DefaultContainer ¶
func DefaultContainer() *Container
type OauthLoginParams ¶
type OauthLoginParams struct {
Referer string
}
type OauthState ¶
OauthState base 64 编码 referer和state信息
Click to show internal directories.
Click to hide internal directories.