增加OAuth支持
This commit is contained in:
29
oauth/define.go
Normal file
29
oauth/define.go
Normal file
@ -0,0 +1,29 @@
|
||||
// Package oauth ...
|
||||
//
|
||||
// Description : oauth ...
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
//
|
||||
// Date : 2022/01/17 12:20 AM
|
||||
package oauth
|
||||
|
||||
// Config OAuth相关配置
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2022/1/17 12:20 AM
|
||||
type Config struct {
|
||||
ClientID string `json:"client_id"` // 授权的client id
|
||||
ClientSecret string `json:"client_secret"` // 授权的client_secret
|
||||
CallbackURL string `json:"callback_url"` // 授权后携带code回调的地址
|
||||
Domain string `json:"domain"` // 服务器域名
|
||||
AuthorizationPageURI string `json:"authorization_page_uri"` // 授权页面URI
|
||||
GetAccessTokenURI string `json:"get_access_token_uri"` // 获取access token地址
|
||||
ValidateAccessTokenURI string `json:"validate_access_token_uri"` // 验证access_token地址
|
||||
AccessTokenKey string `json:"access_token_key"` // 验证access token时的key
|
||||
UseAuthorization bool `json:"use_authorization"` // 是否使用header中的Authorization
|
||||
FormatAccessTokenFunc FormatAccessTokenFunc `json:"format_access_token_func"` // 格式化token的函数
|
||||
}
|
||||
|
||||
// FormatAccessTokenFunc 格式化token
|
||||
type FormatAccessTokenFunc func(token string) string
|
Reference in New Issue
Block a user