Documentation ¶
Index ¶
- Constants
- func ProcessAccessToken(auth *OAuth2, request *restful.Request, response *restful.Response)
- func ProcessGrantTypeClientCredentials(auth *OAuth2, request *restful.Request, response *restful.Response)
- func ProcessGrantTypeCode(auth *OAuth2, request *restful.Request, response *restful.Response)
- func ProcessGrantTypePassword(auth *OAuth2, request *restful.Request, response *restful.Response)
- func ProcessGrantTypeRefreshToken(auth *OAuth2, request *restful.Request, response *restful.Response)
- func ProcessRespTypeCode(auth *OAuth2, request *restful.Request, response *restful.Response)
- func ProcessRespTypeToken(auth *OAuth2, request *restful.Request, response *restful.Response)
- func ProcessRespTypeWebCode(auth *OAuth2, request *restful.Request, response *restful.Response)
- func ProcessRespTypeWebToken(auth *OAuth2, request *restful.Request, response *restful.Response)
- func ProcessRevokeToken(auth *OAuth2, request *restful.Request, response *restful.Response)
- func Run(host, port string)
- type GrantTypeFunc
- type OAuth2
- func (auth *OAuth2) Close()
- func (auth *OAuth2) Handle(c *restful.Container)
- func (auth *OAuth2) RegisterGrantProcessor(grant_type string, function GrantTypeFunc)
- func (auth *OAuth2) RegisterRespProcessor(resp_type string, function ResponseTypeFunc)
- func (auth *OAuth2) RegisterRespWebProcessor(resp_type string, function ResponseTypeFunc)
- func (auth *OAuth2) Run(host, port string)
- func (auth *OAuth2) RunWithContainer(wsContainer *restful.Container, host, port string)
- type ResponseTypeFunc
Constants ¶
View Source
const ( RESPONSE_TYPE_CODE = "code" RESPONSE_TYPE_TOKEN = "token" GRANT_TYPE_CODE = "authorization_code" GRANT_TYPE_IMPLICIT = "implicit" GRANT_TYPE_PASSWORD = "password" GRANT_TYPE_CLIENTCERD = "client_credentials" GRANT_TYPE_DEVICECODE = "device code" GRANT_TYPE_REFRESHTOKEN = "refresh_token" )
Variables ¶
This section is empty.
Functions ¶
func ProcessAccessToken ¶
func ProcessAccessToken(auth *OAuth2, request *restful.Request, response *restful.Response)
func ProcessGrantTypeClientCredentials ¶
func ProcessGrantTypeClientCredentials(auth *OAuth2, request *restful.Request, response *restful.Response)
func ProcessGrantTypeCode ¶
func ProcessGrantTypeCode(auth *OAuth2, request *restful.Request, response *restful.Response)
func ProcessGrantTypePassword ¶
func ProcessGrantTypePassword(auth *OAuth2, request *restful.Request, response *restful.Response)
func ProcessGrantTypeRefreshToken ¶
func ProcessGrantTypeRefreshToken(auth *OAuth2, request *restful.Request, response *restful.Response)
func ProcessRespTypeCode ¶
func ProcessRespTypeCode(auth *OAuth2, request *restful.Request, response *restful.Response)
func ProcessRespTypeToken ¶
func ProcessRespTypeToken(auth *OAuth2, request *restful.Request, response *restful.Response)
func ProcessRespTypeWebCode ¶
func ProcessRespTypeWebCode(auth *OAuth2, request *restful.Request, response *restful.Response)
func ProcessRespTypeWebToken ¶
func ProcessRespTypeWebToken(auth *OAuth2, request *restful.Request, response *restful.Response)
func ProcessRevokeToken ¶
func ProcessRevokeToken(auth *OAuth2, request *restful.Request, response *restful.Response)
Types ¶
type GrantTypeFunc ¶
type GrantTypeFunc func(auth *OAuth2, request *restful.Request, response *restful.Response)
type OAuth2 ¶
type OAuth2 struct { Addr string UserManager defines.UserManager ClientManager defines.ClientManager DataManager defines.DataManager EventListener defines.EventListener CodeExpireTime time.Duration ErrorLog *log.Logger LogHttpInfo bool // contains filtered or unexported fields }
func NewWithWebCode ¶
func (*OAuth2) RegisterGrantProcessor ¶
func (auth *OAuth2) RegisterGrantProcessor(grant_type string, function GrantTypeFunc)
func (*OAuth2) RegisterRespProcessor ¶
func (auth *OAuth2) RegisterRespProcessor(resp_type string, function ResponseTypeFunc)
func (*OAuth2) RegisterRespWebProcessor ¶
func (auth *OAuth2) RegisterRespWebProcessor(resp_type string, function ResponseTypeFunc)
func (*OAuth2) RunWithContainer ¶
type ResponseTypeFunc ¶
type ResponseTypeFunc func(auth *OAuth2, request *restful.Request, response *restful.Response)
Click to show internal directories.
Click to hide internal directories.