Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidRequest should be used whenever the receiver failed to parse the request ErrInvalidRequest = Error{"invalid_request", "Access Token not valid", http.StatusBadRequest} // ErrInvalidToken should be used whenever the receiver failed to validate a JWT Token ErrInvalidToken = Error{"invalid_token", "Access Token not valid", http.StatusUnauthorized} )
Functions ¶
func AccessTokenFromRequest ¶
AccessTokenFromRequest can be used to extract an Access Token from an http.Request via the standard headers/parameters
Ref: https://tools.ietf.org/html/rfc6749#section-5.1 https://tools.ietf.org/html/rfc6750#section-2.1
Types ¶
type Error ¶
type Error struct { Error string `json:"error"` ErrorDescription string `json:"error_description"` // contains filtered or unexported fields }
Error type is used to wrap standard error messages that can be easily marshaled to JSON
func (*Error) Write ¶
func (e *Error) Write(w http.ResponseWriter)
Write will write the Error e to the response writer, marshaled as JSON, and with the respective Status Code
Click to show internal directories.
Click to hide internal directories.