Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromAuthHeader ¶
FromAuthHeader is the default extractor. It expects the 'Authorization' header to be in the form 'Bearer <token>'. If the header is non-existent or empty, it returns an empty string. Otherwise, if successful, returns the token part.
Types ¶
type Core ¶
type Core struct {
Options *Options
}
Core is the main structure which provides an interface for checking the token.
func New ¶
New returns a new Core with the given options. It supplies default options for some fields (check Options type for details).
type Options ¶
type Options struct { // Function that will return the Key to the JWT, public key or shared secret. // Defaults to nil. Keyfunc jwt.Keyfunc // Function that will extract the JWT from the request. // Defaults to 'Authorization' header being of the form 'Bearer <token>' Extractor TokenExtractor // Which algorithm to use. // Defaults to jwt.SigningMethodHS256 SigningMethod jwt.SigningMethod }
Options determine the behavior of the checking functions.
Click to show internal directories.
Click to hide internal directories.