nginx-ldap-auth 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
nginx-ldap-auth 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
nginx-ldap-auth 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 Apache-2.0
开发语言 Google Go 查看源码 »
操作系统 跨平台
软件类型 开源软件
开源组织
地区 国产
投 递 者 小冯冯
适用人群 未知
收录时间 2018-07-04

软件简介

nginx-ldap-auth

基于 ngx_http_auth_request_module 的 Nginx 反向代理 LDAP 认证。Golang 实现

usage

Build from source

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

这里会 pack 出一个 tar 包,拿去部署即可 也可以直接从 release 下载编译好的版本

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

{
     // 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"], // 这些 IP 会被直接干掉
            "direct":[] // 直通的 IP 不需要认证
        },
        "timeAcl":{
            "deny":["00:00-08:00","17:00-23:59"], // 这些时间范围的访问会被 deny
            "direct":[]  // 这些时间访问会直通
        },
        "allowUser":["user1"]  // 允许认证通过的用户名,如果允许所有的 LDAP 用户通过认证,那么这里留空。
    },
    "http": {
        "debug":false,
        "ips":["127.0.0.1"], // 调用 API 所信任的 IP 范围
        "listen": "0.0.0.0:8080"
    }
}
展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击加入讨论🔥(3) 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
3 评论
24 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部