express-oauth2-handler

Expressjs oauth2.0 middleware using JWT

Usage no npm install needed!

<script type="module">
  import expressOauth2Handler from 'https://cdn.skypack.dev/express-oauth2-handler';
</script>

README

express-oauth2

Expressjs middleware implement oauth2.

This middleware delegate AUTHENTICATION to AuthProviders, bundled with this module tow authProviders - Memory and Sqlite3 has been implemented just for testing purpose. You should implement your own authorization providers with different backend Identity Managers e.g. LDAP, Postgres, or 3rd party services.

TODO

  1. Implement asymmetric encryption. Now only passphrase encryption supported.
  2. Implement Authorization Code flow
  3. Implement refresh token flow

Dependencies

[express]

[jsonwebtoken]

[cookie-parser]

[body-parser]

Testing

mocha is required to run unit tests.

In the project root directory run the following:

npm install mocha
npm test