Documentation ¶
Index ¶
- Variables
- func HandleAuthorizeRequest(c echo.Context) error
- func HandleTokenRequest(c echo.Context) error
- func InitServer(manager *manage.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)
- func TokenHandler() echo.MiddlewareFunc
- func TokenHandlerWithConfig(cfg *Config) echo.MiddlewareFunc
- type Config
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultConfig is the default middleware config. DefaultConfig = Config{ TokenKey: "token", Skipper: func(_ echo.Context) bool { return false }, } )
Functions ¶
func HandleAuthorizeRequest ¶
func HandleAuthorizeRequest(c echo.Context) error
HandleAuthorizeRequest the authorization request handling
func HandleTokenRequest ¶
func HandleTokenRequest(c echo.Context) error
HandleTokenRequest token request handling
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
func TokenHandler ¶
func TokenHandler() echo.MiddlewareFunc
TokenHandler gets the token from request using default config
func TokenHandlerWithConfig ¶
func TokenHandlerWithConfig(cfg *Config) echo.MiddlewareFunc
TokenHandlerWithConfig gets the token from request with given config