Documentation ¶
Index ¶
- Constants
- func AuthCodeCallback() gin.HandlerFunc
- func AuthToken() gin.HandlerFunc
- func GetAuthCodeURL(state string) string
- func GetAuthTokenURL(state string) string
- func GroupCheck(name string) gin.HandlerFunc
- func LoginHandler(ctx *gin.Context)
- func Setup(redirectURL, clientID, clientSecret string, scopes []string)
- func TokenHandler(ctx *gin.Context)
- type InfoToken
- type User
Constants ¶
View Source
const ( KeyState = "_state" KeyToken = "_tok" )
Variables ¶
This section is empty.
Functions ¶
func AuthToken ¶
func AuthToken() gin.HandlerFunc
func GetAuthCodeURL ¶
func GetAuthTokenURL ¶
func GroupCheck ¶
func GroupCheck(name string) gin.HandlerFunc
func LoginHandler ¶
func TokenHandler ¶
Types ¶
type InfoToken ¶
type InfoToken struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` ExpiresIn int64 `json:"expires_in,omitempty"` Expiry time.Time `json:"expiry,omitempty"` Me User `json:"me,omitempty"` }
func (*InfoToken) GetAuthedUrl ¶
for redux-auth
type User ¶
type User struct { Uid string `json:"uid"` // 登录名 CommonName string `json:"cn,omitempty"` // 全名 GivenName string `json:"gn" form:"gn" binding:"required"` // 名 Surname string `json:"sn" form:"sn" binding:"required"` // 姓 Nickname string `json:"nickname,omitempty" form:"nickname"` // 昵称 Birthday string `json:"birthday,omitempty" form:"birthday"` // 生日 Gender uint8 `json:"gender,omitempty"` // 1=male, 2=female, 0=unknown Mobile string `json:"mobile,omitempty"` Email string `json:"email,omitempty"` EmployeeNumber string `json:"eid,omitempty" form:"eid"` EmployeeType string `json:"etype,omitempty" form:"etitle"` AvatarPath string `json:"avatarPath,omitempty" form:"avatar"` Provider string `json:"provider"` }
User is a retrieved and authenticated user.
Click to show internal directories.
Click to hide internal directories.