http.jwt Plugin

This feature does not come with Caddy by default. To get it, select the http.jwt plugin when you download Caddy.

This middleware implements an authorization layer for Caddy based on JSON Web Tokens (JWT).

Full documentation

Examples

Basic Syntax

jwt [path]

By default every resource under path will be secured using JWT validation. To specify a list of resources that need to be secured, use multiple declarations. Be sure to read the plugin documentation to properly configure your server to validate your tokens.

Advanced Syntax

jwt { path [path] redirect [location] allow [claim] [value] deny [claim] [value] }

You can optionally use claim information to further control access to your routes. In a jwt block you can specify rules to allow or deny access based on the value of a claim. You can also specify a redirect URL so that invalid tokens can be sent to a login page. Check out the plugin documentation for more information about how to use the advanced syntax. It has more detailed examples of how the plugin will pass claims to your application.

Related Links

Documentation

Access the full documentation for this plugin off-site:

Docs

Plugin Help

Get help from the maintainers of the http.jwt plugin:

Support

Plugin Website

Visit http.jwt’s website for more information:

Website

Plugin Author: Bryan Burke

Last Updated: 25 Mar 2017, 1:05 PM

This plugin is independent of the Caddy project and is not endorsed or maintained by Caddy developers. Use at your own risk. Do not file issues for this plugin on Caddy’s bug tracker.