Skip to content

MiddlewareConfig

thiagobustamante edited this page Jun 19, 2017 · 3 revisions

This will configure a reference to a custom middleware and supports the following properties:

Property Type Description Required
name string The name of the middleware to be used. true
options any Any options that will be passed to middleware initialization. false

Example:

{
    "middleware": {
        "name": "jwt",
        "options": {
            "extractFrom": {
                "authHeader": "Bearer",
                "queryParam": "jwt"
            },
            "secretOrKey": "secret",
            "algorithms": ["HS256", "HS384"],
            "ignoreExpiration": true,
            "verify": {
                "name": "verifyJwtUser"
            }
        }
    }
} 

or

middleware:
  name: jwt
  options:
    extractFrom:
      authHeader: Bearer
      queryParam: jwt
    secretOrKey: secret
    algorithms:
    - HS256
    - HS384
    ignoreExpiration: true
    verify:
      name: verifyJwtUser

Note that any middleware needs to follow the insctructions defined here.

Clone this wiki locally