GithubHelp home page GithubHelp logo

jwt_signer's Introduction

jwt_signer

jwt_signer is a Lua hook script implemented for the Apache2 HTTP server. Its function is to compute the JWT's (JSON Web Tokens) signature section based on the header and payload portion received from the client. After assembling a complete JWT, it places it into the 'Authorization' header, and subsequently passes it along to the next Apache2 module.

Quick Start

Installation

To clone the repository and install jwt_signer, run:

git clone https://github.com/vivimice/jwt_signer.git
cd jwt_signer
sudo ./install.sh

Configure

LuaHookAuthChecker /usr/local/lib/jwt_signer/jwt_signer.lua sign
SetEnvIf Host .*   JWT_SIGNER_SECRET=your-256-bit-secret

Replacing your-256-bit-secret with the shared secret between parties.

Activation

Finally, to enable necessary modules, check the updated configuration, and reload your Apache2 instance for the changes to take effect, use the following commands:

sudo a2enmod lua setenvif
sudo apache2ctl configtest && sudo apache2ctl graceful

Security Consideration

To avoid the unintended exposure of the secret used for signing the JWT token, ensure that the configuration file containing the SetEnv-If directive is not accessible by any unnecessary user on the server.

Acknowledgments

I would like to express my gratitude to Egor Skriptunoff for creating the pure_lua_SHA library that plays a crucial role in the development of jwt_signer. I am truly thankful for the hard work and the open-source nature of the library, which has allowed me to build upon their foundation and achieve my project's objectives.

jwt_signer's People

Contributors

vivimice avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.