{"repo":"auth0/express-jwt","free":true,"listed":false,"github":"https://github.com/auth0/express-jwt","clone":"git clone https://github.com/auth0/express-jwt.git","description":"connect/express middleware that validates a JsonWebToken (JWT) and set the req.user with the attributes","language":"TypeScript","stars":4514,"topics":["express-jwt","jwt"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"express-jwt This module provides Express middleware for validating JWTs (JSON Web Tokens) through the jsonwebtoken module. The decoded JWT payload is available on the request object. Install API expressjwt(options) Options has the following parameters: - secret: jwt.Secret GetVerificationKey (required): The secret as a string or a function to retrieve the secret. - getToken?: TokenGetter (optional): A function that receives the express Request and returns the token, by default it looks in the Authorization header. - isRevoked?: IsRevoked (optional): A function to verify if a token is revoked. - onExpired?: ExpirationHandler (optional): A function to handle expired tokens. - credentialsRequired?: boolean (optional): If its false, continue to the next middleware if the request does not contain a token instead of failing, defaults to true. - requestProperty?: string (optional): Name of the property in the request object where the payload is set. Default to req.auth . - Plus... all the options available in the jsonwebtoken verify function. The available functions have the following interface: - GetVerificationKey = (req: express.Request, token: jwt.Jwt undefined) = Promise ; - IsRevoked = (req: express.Request, token: jwt.Jwt undefined) = Promise ; - TokenGetter = (req: express.Request) = string Promise undefined; Usage Basic usage using an HS256 secret: The decoded JWT payload is available on the request via the auth property. The default behavior of the module is to extract the","default_branch":null,"files":null,"tree":[],"storefront":"/r/auth0","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/auth0/express-jwt/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}