0.0.10 • Published 4 years ago

express-gateway-plugin-jwt-forwarder v0.0.10

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

express-gateway-plugin-jwt-forwarder

This plugin for Express Gateway makes it possible to forward JWT payload through headers.

Why ? If your want to access specific JWT payload fields easily (i.e. sub to access your current user identifiant) trough http headers in your APIs without having to deal with JWT at all!

IMPORTANT: This plugin DOES NOT validate JWT, it is just forwarding its payload. This means that you must validate it first using built-in jwt policy or jwks plugin or whatever.

Installation

Simply type from your shell environment:

eg plugin install express-gateway-plugin-jwt-forwarder

Quick start

  1. Make sure the plugin is listed in system.config.yml file. This is done automatically for you if you used the command above.

  2. Add the configuration keys to gateway.config.yml file.

Default use case

policies:
  - jwks: # You should validate your jwt before forwarding its fields (use whatever policy you want for validation of course :-))
  - jwt-forwarder:

Note: this will forward the header "x-jwt-sub" with the value of the jwt "sub" field

Custom use case

policies:
  - jwks: # You should validate your jwt before forwarding its fields (use whatever policy you want for validation of course :-))
  - jwt-forwarder:
      - action:
          prefix: 'custom-prefix-'
          fields: ['sub', 'iss', 'custom-field']

Want to make your own plugin?

Just check out our plugin development guide. We can't wait to see your custom stuff in the Gateway!

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago