Documentation ¶
Index ¶
- Variables
- func HandleAuthorizeRequest(c *gin.Context)
- func HandleTokenRequest(c *gin.Context)
- func HandleTokenVerify(config ...Config) gin.HandlerFunc
- func InitServer(manager oauth2.Manager) *server.Server
- func SetAccessTokenExpHandler(handler server.AccessTokenExpHandler)
- func SetAllowGetAccessRequest(allow bool)
- func SetAllowedGrantType(types ...oauth2.GrantType)
- func SetAllowedResponseType(types ...oauth2.ResponseType)
- func SetAuthorizeScopeHandler(handler server.AuthorizeScopeHandler)
- func SetClientAuthorizedHandler(handler server.ClientAuthorizedHandler)
- func SetClientInfoHandler(handler server.ClientInfoHandler)
- func SetClientScopeHandler(handler server.ClientScopeHandler)
- func SetExtensionFieldsHandler(handler server.ExtensionFieldsHandler)
- func SetInternalErrorHandler(handler server.InternalErrorHandler)
- func SetPasswordAuthorizationHandler(handler server.PasswordAuthorizationHandler)
- func SetRefreshingScopeHandler(handler server.RefreshingScopeHandler)
- func SetResponseErrorHandler(handler server.ResponseErrorHandler)
- func SetTokenType(tokenType string)
- func SetUserAuthorizationHandler(handler server.UserAuthorizationHandler)
- type Config
- type ErrorHandleFunc
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func HandleAuthorizeRequest ¶
HandleAuthorizeRequest the authorization request handling
func HandleTokenRequest ¶
HandleTokenRequest token request handling
func HandleTokenVerify ¶
func HandleTokenVerify(config ...Config) gin.HandlerFunc
HandleTokenVerify Verify the access token of the middleware
func InitServer ¶
InitServer Initialize the service
func SetAccessTokenExpHandler ¶
func SetAccessTokenExpHandler(handler server.AccessTokenExpHandler)
SetAccessTokenExpHandler set expiration date for the access token
func SetAllowGetAccessRequest ¶
func SetAllowGetAccessRequest(allow bool)
SetAllowGetAccessRequest to allow GET requests for the token
func SetAllowedGrantType ¶
func SetAllowedGrantType(types ...oauth2.GrantType)
SetAllowedGrantType allow the grant types
func SetAllowedResponseType ¶
func SetAllowedResponseType(types ...oauth2.ResponseType)
SetAllowedResponseType allow the authorization types
func SetAuthorizeScopeHandler ¶
func SetAuthorizeScopeHandler(handler server.AuthorizeScopeHandler)
SetAuthorizeScopeHandler set scope for the access token
func SetClientAuthorizedHandler ¶
func SetClientAuthorizedHandler(handler server.ClientAuthorizedHandler)
SetClientAuthorizedHandler check the client allows to use this authorization grant type
func SetClientInfoHandler ¶
func SetClientInfoHandler(handler server.ClientInfoHandler)
SetClientInfoHandler get client info from request
func SetClientScopeHandler ¶
func SetClientScopeHandler(handler server.ClientScopeHandler)
SetClientScopeHandler check the client allows to use scope
func SetExtensionFieldsHandler ¶
func SetExtensionFieldsHandler(handler server.ExtensionFieldsHandler)
SetExtensionFieldsHandler in response to the access token with the extension of the field
func SetInternalErrorHandler ¶
func SetInternalErrorHandler(handler server.InternalErrorHandler)
SetInternalErrorHandler internal error handling
func SetPasswordAuthorizationHandler ¶
func SetPasswordAuthorizationHandler(handler server.PasswordAuthorizationHandler)
SetPasswordAuthorizationHandler get user id from username and password
func SetRefreshingScopeHandler ¶
func SetRefreshingScopeHandler(handler server.RefreshingScopeHandler)
SetRefreshingScopeHandler check the scope of the refreshing token
func SetResponseErrorHandler ¶
func SetResponseErrorHandler(handler server.ResponseErrorHandler)
SetResponseErrorHandler response error handling
func SetUserAuthorizationHandler ¶
func SetUserAuthorizationHandler(handler server.UserAuthorizationHandler)
SetUserAuthorizationHandler get user id from request authorization
Types ¶
type Config ¶
type Config struct { // error handling when starting the session ErrorHandleFunc ErrorHandleFunc // keys stored in the context TokenKey string // defines a function to skip middleware.Returning true skips processing // the middleware. Skipper func(*gin.Context) bool }
Config defines the config for Session middleware