Skip to content

Commit f39b87f

Browse files
committedOct 27, 2017
Merge branch 'add-auth0-sponsor'
2 parents cfb13c0 + 3401015 commit f39b87f

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed
 

‎README.md

+5-12
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,14 @@ Finally, the URL query parameters will be checked for a field matching either
151151
`options.tokenQueryParameterName` or `auth_token` if the option was not
152152
specified.
153153

154-
## Migrating from 2.x.x to 3.x.x
154+
## Supported By
155155

156-
Version 3.0.0 removes the `ExtractJwt.fromAuthHeader()` extractor function that would extract
157-
JWT's from `Authorization` headers with the auth scheme 'jwt'. The default authorization scheme
158-
of 'jwt' as the was not RFC 6750 compliant. The extractor was replaced with
159-
`ExtractJwt.fromAuthHeaderAsBearerToken()`. The removal of `ExtractJwt.fromAuthHeader()` was done
160-
to clearly change the API so any code relying on the old API would clearly break, hopefully saving
161-
people some debugging time.
156+
If you want to quickly add secure token-based authentication to Node.js apps, feel free to check out Auth0's Node.js SDK and free plan at [auth0.com/overview](https://auth0.com/overview?utm_source=GHsponsor&utm_medium=GHsponsor&utm_campaign=passport-jwt&utm_content=auth) <img alt='Auth0 Logo' src='https://s3.amazonaws.com/passport-jwt-img/Auth0+logo.svg'/>
162157

163-
If you want to maintain the behavior of `ExtractJwt.fromAuthHeader()` when switching to v3.3.0, simply
164-
replace it with `ExtractJwt.fromAuthHeaderWithScheme('jwt')` in your implementation.
158+
## Migrating
165159

166-
## Migrating from version 1.x.x to 2.x.x
167-
168-
See [the guide for migrating from v1 to v2](docs/migrating_v1_to_v2.md) for explanation of the major changes.
160+
The the [Migration Guide](docs/migrating.md) for help upgrading to the latest
161+
major version of passport-jwt
169162

170163
## Tests
171164

‎docs/migrating_v1_to_v2.md ‎docs/migrating.md

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
# Migrating from version 1.x.x to 2.x.x
1+
# Migration Guide
2+
3+
The following instructions should help in migrating to a new major version of
4+
passport-jwt.
5+
6+
## Migrating from 2.x.x to 3.x.x
7+
8+
Version 3.0.0 removes the `ExtractJwt.fromAuthHeader()` extractor function that would extract
9+
JWT's from `Authorization` headers with the auth scheme 'jwt'. The default authorization scheme
10+
of 'jwt' as the was not RFC 6750 compliant. The extractor was replaced with
11+
`ExtractJwt.fromAuthHeaderAsBearerToken()`. The removal of `ExtractJwt.fromAuthHeader()` was done
12+
to clearly change the API so any code relying on the old API would clearly break, hopefully saving
13+
people some debugging time.
14+
15+
If you want to maintain the behavior of `ExtractJwt.fromAuthHeader()` when switching to v3.3.0, simply
16+
replace it with `ExtractJwt.fromAuthHeaderWithScheme('jwt')` in your implementation.
17+
18+
## Migrating from version 1.x.x to 2.x.x
19+
220
The v2 API is not backwards compatible with v1, specifically with regards to the introduction
321
of the concept of JWT extractor functions. If you require the legacy behavior in v1 you can use
422
the extractor function ```versionOneCompatibility(options)```
@@ -35,5 +53,3 @@ opts.issuer = 'accounts.examplesoft.com';
3553
opts.audience = 'yoursite.net';
3654
passport.use(new JwtStrategy(opts, verifyFunction));
3755
```
38-
39-

0 commit comments

Comments
 (0)
Please sign in to comment.