racx / cas-auth-lua-nginx

A Lua module to authenticate CAS users on NGINX level.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NGINX CAS authentication module in Lua

This is a POC project of a Lua module to authenticate CAS users on NGINX before reaching the application.

How the module works

After authenticating, the following cookies are created:

usrtoken: is a sha1 + base64 signed cookie with a secret

usrid: is a base64 signed cookie representing the CAS username

Configuration

Edit the nginx configuration: config/default

Replace $cas_server with your CAS ticket authentication URL

Replace $secret with a secretive token

Example

The example rails application demonstrates how to verify the signed cookie

About

A Lua module to authenticate CAS users on NGINX level.

License:Apache License 2.0


Languages

Language:Ruby 85.6%Language:Lua 6.4%Language:CSS 3.9%Language:JavaScript 3.0%Language:CoffeeScript 1.0%