Giter Site home page Giter Site logo

travislee8964 / nginx-ldap-auth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shanghai-edu/nginx-ldap-auth

0.0 2.0 0.0 40 KB

A simple example of LDAP authentication using ngx_http_auth_request_module by golang.

License: Apache License 2.0

Shell 7.60% Go 57.48% CSS 5.53% JavaScript 10.10% Smarty 19.29%

nginx-ldap-auth's Introduction

nginx-ldap-auth

A simple example of LDAP authentication using ngx_http_auth_request_module by golang.

δΈ­ζ–‡

usage

Build from source

# git clone https://github.com/shanghai-edu/nginx-ldap-auth
# go get ./...
# chmod +x control
# ./control build
# ./control pack

Install

# tar -zxvf nginx-ldap-auth-0.1.tar.gz 
# cp nginx.conf /etc/nginx/nginx.conf
# mv cfg.example.json cfg.json // and change it 
# service nginx reload
# ./control start

cfg.json example

{
     // ldap config
    "ldap": {
        "addr": "ldap.example.org:389",
        "baseDn": "dc=example,dc=org",
        "bindDn": "cn=manager,dc=example,dc=org",
        "bindPass": "password",
        "authFilter": "(&(uid=%s))",
        "attributes": ["uid", "cn", "mail"],
        "tls":        false,
        "startTLS":   false
    },
    // control config
    "control":{
        "ipAcl":{
            "deny":["127.0.0.1","192.168.0.0/24","192.168.1.0-192.168.1.255"], // deny ips
            "direct":[] // direct ips
        },
        "timeAcl":{
            "deny":["00:00-08:00","17:00-23:59"], // time deny
            "direct":[]  // time direct
        },
        "allowUser":["user1"]  // user allowed to login, should be [] if all ldap users are allowed
    },
    "http": {
        "debug":false,
        "ips":["127.0.0.1"], // api trust ips
        "listen": "0.0.0.0:8080"
    }
}

nginx-ldap-auth's People

Contributors

freedomkk-qfeng 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.