All Projects → max-lt → nginx-jwt-module

max-lt / nginx-jwt-module

Licence: MIT License
NGINX module to check for a valid JWT.

Programming Languages

c
50402 projects - #5 most used programming language
shell
77523 projects
Dockerfile
14818 projects
Makefile
30231 projects

Projects that are alternatives of or similar to nginx-jwt-module

Docker Oidc Proxy
Docker Image built on Alpine Linux for secure OpenID Connect (OIDC) proxy authentication
Stars: ✭ 91 (+133.33%)
Mutual labels:  alpine, nginx-proxy
docker-jitsi-meet
Docker Jitsi Meet WebRTC conferencing system w/Prosody XMPP and s6 overlay
Stars: ✭ 66 (+69.23%)
Mutual labels:  alpine, nginx-proxy
Lua Nginx Redis
🌺 Redis、Lua、Nginx、OpenResty 笔记和资料
Stars: ✭ 757 (+1841.03%)
Mutual labels:  nginx-proxy, nginx-module
vim-humanoid-colorscheme
Light and dark theme for vim with bright colors
Stars: ✭ 67 (+71.79%)
Mutual labels:  light
rpi-docker-letsencrypt-nginx-proxy-companion
RPI-compatible LetsEncrypt companion container for nginx-proxy
Stars: ✭ 42 (+7.69%)
Mutual labels:  nginx-proxy
SyntaxNet-Tensorflow
Minimal Tensorflow Docker image with SyntaxNet/DRAGNN based on Alpine linux
Stars: ✭ 35 (-10.26%)
Mutual labels:  alpine
hookah
Deploying apps directly from a git push
Stars: ✭ 36 (-7.69%)
Mutual labels:  nginx-proxy
docker-aws-s3-sync
Docker container to sync a folder to Amazon S3
Stars: ✭ 21 (-46.15%)
Mutual labels:  alpine
docker-mysql-cron-backup
Docker image to backup all your databases periodically
Stars: ✭ 144 (+269.23%)
Mutual labels:  alpine
lifx-http-api
💡 Thin wrapper around the Lifx HTTP API (http://api.developer.lifx.com/)
Stars: ✭ 17 (-56.41%)
Mutual labels:  light
github-theme-for-jetbrains
GitHub Theme for Jetbrains is heavily inspired by GitHub 3 Color Scheme and github-vscode-theme.The focus of the development of this theme plugin is to restore the official GitHub theme as much as possible, keeping the colors easy to distinguish, proper contrast, and pleasant.
Stars: ✭ 20 (-48.72%)
Mutual labels:  light
GodlyTorch
[NOT MAINTAINED] An app that can control the intensity of the torch of your rooted android device.
Stars: ✭ 16 (-58.97%)
Mutual labels:  light
docker-base
Just enough to get process supervision and startup mechanisms
Stars: ✭ 25 (-35.9%)
Mutual labels:  alpine
spring-boot-docker
Lightweight Spring Boot Docker image based on Alpine + Docker Compose file
Stars: ✭ 25 (-35.9%)
Mutual labels:  alpine
packages
Cloud Posse DevOps distribution of linux packages for native apps, binaries, alpine packages, debian packages, and redhat packages.
Stars: ✭ 107 (+174.36%)
Mutual labels:  alpine
wordpress-php
PHP docker container image for WordPress
Stars: ✭ 24 (-38.46%)
Mutual labels:  alpine
openrgb ha
OpenRGB integration for Home Assistant
Stars: ✭ 40 (+2.56%)
Mutual labels:  light
docker-flask
Alpine + Docker + Flask + Gunicorn + Supervisor
Stars: ✭ 16 (-58.97%)
Mutual labels:  alpine
Lumos
😴 Smart Lighting for Better Sleep
Stars: ✭ 98 (+151.28%)
Mutual labels:  light
docker-formio-api
Docker Form.io Server based on Debian w/s6 init, Zabbix Monitoring
Stars: ✭ 14 (-64.1%)
Mutual labels:  alpine

Nginx jwt auth module

Build Status Build Status Docker pulls

This is an NGINX module to check for a valid JWT.

Inspired by TeslaGov, ch1bo and tizpuppi, this module intend to be as light as possible and to remain simple.

Module:

Example Configuration:

server {
    auth_jwt_key "0123456789abcdef" hex; # Your key as hex string
    auth_jwt     off;

    location /secured-by-cookie/ {
        auth_jwt $cookie_MyCookieName;
    }

    location /secured-by-auth-header/ {
        auth_jwt on;
    }

    location /secured-by-auth-header-too/ {
        auth_jwt_key "another-secret"; # Your key as utf8 string
        auth_jwt on;
    }

    location /secured-by-rsa-key/ {
        auth_jwt_key /etc/keys/rsa-public.pem file; # Your key from a PEM file
        auth_jwt on;
    }

    location /not-secure/ {}
}

Note: don't forget to load the module in the main context:
load_module /usr/lib/nginx/modules/ngx_http_auth_jwt_module.so;

Directives:

Syntax:	 auth_jwt $variable | on | off;
Default: auth_jwt off;
Context: http, server, location

Enables validation of JWT.


Syntax:	 auth_jwt_key value [encoding];
Default: ——
Context: http, server, location

Specifies the key for validating JWT signature (must be hexadecimal).
The encoding otpion may be hex | utf8 | base64 | file (default is utf8).
The file option requires the value to be a valid file path (pointing to a PEM encoded key).


Syntax:	 auth_jwt_alg any | HS256 | HS384 | HS512 | RS256 | RS384 | RS512 | ES256 | ES384 | ES512;
Default: auth_jwt_alg any;
Context: http, server, location

Specifies which algorithm the server expects to receive in the JWT.

Build:

This module is built inside a docker container, from the nginx-alpine image.

./build.sh # Will create a "jwt-nginx" (Dockerfile)

Test:

Default usage:

./test.sh # Will create a "jwt-nginx-test" image (from test-image/Dockerfile) based on the "jwt-nginx" one.

Set image name:

./test.sh your-image-to-test

example:

./test.sh jwt-nginx-s1 # tests the development image

Use current container:

./test.sh --current my-container

example:

# In a first terminal:
docker run --rm --name my-test-container -p 8000:8000 jwt-nginx-test

# In a second one:
./test.sh --current my-test-container
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].