Skip to content

Commit

Permalink
Update Including JWT section for extractors
Browse files Browse the repository at this point in the history
Fixes #138
  • Loading branch information
mikenicholson committed Mar 13, 2018
1 parent 2c3183f commit bafdf99
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,12 @@ app.post('/profile', passport.authenticate('jwt', { session: false }),

### Include the JWT in requests

The strategy will first check the request for the standard *Authorization*
header. If this header is present and the scheme matches `options.authScheme`
or 'JWT' if no auth scheme was specified then the token will be retrieved from
it. e.g.
The method of including a JWT in a request depends entirely on the extractor
function you choose. For example, if you use the `fromAuthHeaderAsBearerToken`
extractor, you would include an `Authorization` header in your request with the
scheme set to `bearer`. e.g.

Authorization: JWT JSON_WEB_TOKEN_STRING.....

If the authorization header with the expected scheme is not found, the request
body will be checked for a field matching either `options.tokenBodyField` or
`auth_token` if the option was not specified.

Finally, the URL query parameters will be checked for a field matching either
`options.tokenQueryParameterName` or `auth_token` if the option was not
specified.
Authorization: bearer JSON_WEB_TOKEN_STRING.....

## Migrating

Expand Down

0 comments on commit bafdf99

Please sign in to comment.