Giter Site home page Giter Site logo

nginx-dlg-auth's Introduction

nginx-dlg-auth

NGINX module for delegating authentication and authorization to an HTTP gateway.

nginx-dlg-auth combines Hawk and iron to enable authentication and authorization using encapsulated tokens.

The token format has been inspired by Oz but is different for now, because in the long run, I think I have somewhat different use cases than Oz is aiming at.

This is all somewhat experimental and will evolve over the next months.

The token format right now is

{"client":"test01","pwd":"v8(9D1A>7n9J<","scope":["NEWS","BLOG"],\
"rw":false,"exp":1405688331,"hawkAlgorithm":"sha256"}

and combines password and algorithm to be used with Hawk as well as access rights and token expiration time.

Status

The module has been used in a production environment for several months and version 1.5 fixes some minor security issues.

Installation

This NGINX module needs ciron and hawkc. Build them separately and adjust nginx-dlg-auth's config file to point to libciron.a and libhawkc.a.

Also, copy the header files ciron.h and hawkc.h to a standard header file location on your machine.

Configure NGINX build like this:

./configure --add-module=/path/to/code/nginx-dlg-auth

You may also want to add the library file to $LINK_DEPS to make sure nginx will correctly relink itself on make if library changes."

NGINX Module Configuration

dlg_auth <realm>

dlg_auth_iron_pwd <password>  OR <passwordID> <password>

dlg_auth_allowed_clock_skew <allowed-skew-in-seconds>

dlg_auth_host <hostname>

dlg_auth_port <port>

dlg_auth

Enables access delegation checking. The parameter is the authentication realm. Tickets must inlcude this realm in their scope to gain access.

If dlg_auth is missing or if realm is 'off', the module will not be enabled. The 'off' value can be used to disable authentication checking in locations that have parent locations that enable checking.

dlg_auth_iron_pwd

You can use dlg_auth_iron_pwd to either set a single password, or to provide a set of passwordIds and password to enable password rotation.

dlg_auth_allowed_clock_skew

Explicitly set the allowed clock skew in seconds. The default is 1 second.

If you set this to 0 clock skew will not be checed. This is useful for monitoring checks.

dlg_auth_host

Explicitly set the host used for signature validation.

dlg_auth_port

Explicitly set the port used for signature validation.

Examples

dlg_auth NEWS
dlg_auth_iron_pwd z3$0O1Y]8x3T+;
dlg_auth_allowed_clock_skew 10



dlg_auth NEWS
dlg_auth_iron_pwd 100922 z3$0O1Y]8x3T+;
dlg_auth_iron_pwd 776277 w1|6Q3V]7s8R);
dlg_auth_iron_pwd 199289 i7(5P3D.4f0D-;
dlg_auth_iron_pwd 662552 a6>0K0G]8z7B=;
dlg_auth_allowed_clock_skew 10

You must not use passwords that contain ';' characters. This would probably confuse nginx config parser.

Variables

The module sets a number of variables to make per request handling information available in later NGINX phases. For example, these variables can be used for logging which client (and/or user) made the request and, possibly, for which resource owner the pertaining grant had been issued.

These variables are available:

  • $dlg_auth_client The client ID of the client that made the request.
  • $dlg_auth_expires The expire timestamp of the ticket used for the request.
  • $dlg_auth_clockskew The skew of the client clock relative to the server clock.

nginx-dlg-auth's People

Contributors

algermissen avatar

Watchers

 avatar  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.