A simple SSO for NGINX, written in Lua
Find a file
Geoff Montel 8abd9ce94d Adding new theme Unsplash forek from "Clouds"
Background change over each photos
Selection of "Nature" performed on Unsplash API
Kept white font for SSO main element
Remaining problems: photos color may lead to unreadable labels. Fix me!
2019-07-09 17:45:23 +02:00
debian Update changelog for 3.6.4 release 2019-07-04 23:35:08 +02:00
lustache licence file added 2018-06-07 13:37:58 +02:00
portal Adding new theme Unsplash forek from "Clouds" 2019-07-09 17:45:23 +02:00
access.lua Allow access in portail in other domain than main domain 2019-05-17 22:42:52 +02:00
conf.json.example Add theming support, add vapor theme 2019-02-21 18:12:24 +01:00
config.lua Add theming support, add vapor theme 2019-02-21 18:12:24 +01:00
CONTRIBUTORS.md [fix] sidddy takes 3 d 2017-05-18 08:56:48 +02:00
helpers.lua info.html -> portal.html 2019-03-19 23:29:46 +01:00
init.lua bugfix scope 2018-06-07 22:33:12 +02:00
LICENSE Add AGPL license 2015-07-15 15:29:45 +02:00
lustache.lua replace hige by lustache 2018-06-07 11:56:34 +02:00
README.md Import patch from lfuelling about overlay, dunno wat this do 2019-02-21 19:21:01 +01:00

SSOwat

A simple LDAP SSO for nginx, written in Lua

Translation status

Issues

Requirements

  • Nginx-extras from Debian wheezy-backports
  • lua-json
  • lua-ldap
  • lua-filesystem
  • lua-socket
  • lua-rex-pcre

OR

Installation

  • Fetch the repository
git clone https://github.com/Kloadut/SSOwat /etc/ssowat

Nginx configuration

  • Add SSOwat's Nginx configuration (http{} scope)
nano /etc/nginx/conf.d/ssowat.conf

lua_shared_dict cache 10m;
init_by_lua_file   /etc/ssowat/init.lua;
access_by_lua_file /etc/ssowat/access.lua;

You can also put the access_by_lua_file directive in a server{} scope if you want to protect only a vhost.

SSOwat configuration

mv /etc/ssowat/conf.json.example /etc/ssowat/conf.json
nano /etc/ssowat/conf.json

If you use YunoHost, you may want to edit the /etc/ssowat/conf.json.persistent file, since the /etc/ssowat/conf.json will often be overwritten.

Available parameters

These are the SSOwat's configuration parameters. Only portal_domain is required, but it is recommended to know the others to fully understand what you can do with SSOwat.

portal_domain

Domain of the authentication portal. It has to be a domain, IP addresses will not work with SSOwat (Required)

portal_path

URI of the authentication portal (default: /ssowat/). This path must end with “/”.

portal_port

Web port of the authentication portal (default: 443 for https, 80 for http)

portal_scheme

Whether authentication should use secure connection or not (default: https)

domains

List of handled domains (default: similar to portal_domain)

ldap_host

LDAP server hostname (default: localhost)

ldap_group

LDAP group to search in (default: ou=users,dc=yunohost,dc=org)

ldap_identifier

LDAP user identifier (default: uid)

ldap_attributes

User's attributes to fetch from LDAP (default: ["uid", "givenname", "sn", "cn", "homedirectory", "mail", "maildrop"])

ldap_enforce_crypt

Let SSOwat re-encrypt weakly-encrypted LDAP passwords into the safer sha-512 (crypt) (default: true)

allow_mail_authentication

Whether users can authenticate with their mail address (default: true)

login_arg

URI argument to use for cross-domain authentication (default: sso_login)

additional_headers

Array of additionnal HTTP headers to set once user is authenticated (default: { "Remote-User": "uid" })

session_timeout

The session expiracy time limit in seconds, since the last connection (default: 86400 / one day)

session_max_timeout

The session expiracy time limit in seconds (default: 604800 / one week)

protected_urls

List of priorily protected URLs and/or URIs (by default, every URL is protected)

protected_regex

List of regular expressions to be matched against URLs and URIs to protect them

skipped_urls

List of URLs and/or URIs that will not be affected by SSOwat. This must be a JSON array, and SSOwat automatically adds itself to this array.

skipped_regex

List of regular expressions to be matched against URLs and URIs to ignore them

unprotected_urls

List of URLs and/or URIs that will not be affected by SSOwat unless user is authenticated

unprotected_regex

List of regular expressions to be matched against URLs and URIs to ignore them unless user is authenticated

redirected_urls

Array of URLs and/or URIs to redirect and their redirect URI/URL (example: { "/": "example.org/subpath" })

redirected_regex

Array of regular expressions to be matched against URLS and URIs and their redirect URI/URL (example: { "example.org/megusta$": "example.org/subpath" })

users

2-level array containing usernames and their allowed URLs along with an App name (example: { "kload": { "kload.fr/myapp/": "My App" } })

default_language

Language code used by default in views (default: en)