jupyterhub的ldap身份验证器

jupyterhub-ldap-authenticator的Python项目详细描述


jupyterhub ldap验证器

jupyterhub的ldap authenticator插件。 这个项目是在考虑企业LDAP集成的情况下编写的,包括 以下功能:

  • 支持多个LDAP服务器,并允许配置服务器池策略
  • 每个身份验证请求使用一个只读LDAP连接
  • 验证LDAP中是否存在身份验证用户,并且该用户是允许的组的成员 在测试身份验证之前
  • 支持在允许的组中使用嵌套组列表
  • 支持在登录时创建域用户主目录

这个项目的灵感来自于ldapauthenticator项目。

安装

使用pip安装:

pip install jupyterhub-ldap-authenticator

配置

要启用ldapauthenticator,请将以下行添加到jupyterhub配置文件中,并使用下面列出的参数扩展配置。

c.JupyterHub.authenticator_class='ldapauthenticator.LDAPAuthenticator'
< DL>
ldapauthenticator.server_主机
服务器的scheme://hostname:hostport格式的名称、IP或完整URL的列表(必需)。
# example- list of complete urlsc.LDAPAuthenticator.server_hosts=['ldaps://ldap1.example.com:636','ldaps://ldap2.example.com:636']# example - list of namesc.LDAPAuthenticator.server_hosts=['ldap1.example.com','ldap2.example.com']# example - list of ipsc.LDAPAuthenticator.server_hosts=['10.0.0.1','10.0.0.2']
< DL>
ldapauthenticator.server_端口
LDAP服务器正在侦听的端口。通常389表示明文连接,636表示安全连接(默认为无)。
# examplec.LDAPAuthenticator.server_port=636
< DL>
ldapauthenticator.server使用SSL
布尔值指定连接是否在安全端口上(默认为false)。
# examplec.LDAPAuthenticator.server_use_ssl=True
< DL>
ldapauthenticator.server_connect_超时
在引发异常之前建立LDAP连接时允许超时(以秒为单位)(默认为无)。
# examplec.LDAPAuthenticator.server_connect_timeout=10
< DL>
ldapauthenticator.server_receive_超时
在引发异常之前,已建立的LDAP连接的响应允许超时(秒)(默认为无)。
# examplec.LDAPAuthenticator.server_receive_timeout=10
< DL>
ldapauthenticator.服务器池策略
可用的池ha策略(默认为"第一个"。
  • 第一个:获取池中的第一个服务器,如果"服务器池活动"设置为true,则获取第一个可用服务器。
  • 循环:每次连接打开时,都会使用池中的后续服务器。如果"服务器池活动"设置为true,则将丢弃不可用的服务器。
  • 随机:每次连接打开时,池中都会选择一个随机服务器。如果"服务器池活动"设置为true,则将丢弃不可用的服务器。
# examplec.LDAPAuthenticator.server_pool_strategy='FIRST'
< DL>
ldapauthenticator.server_pool_活动
如果为true,服务器池策略将检查服务器可用性。设置为整数表示放弃前要尝试的最大循环数(默认为true)。
# example - booleanc.LDAPAuthenticator.server_pool_active=True# example - maximum number of triesc.LDAPAuthenticator.server_pool_active=3
< DL>
ldapauthenticator.server_pool_exhaust
如果为true,则将从池中删除所有非活动服务器。如果设置为整数,这将是无法访问的服务器被视为脱机的秒数。当超时过期时,服务器将重新插入池中并再次检查可用性(默认为false)。
pip install jupyterhub-ldap-authenticator
0 < DL>
ldapauthenticator.绑定用户
要登录进行简单绑定的用户帐户(默认为无)。
pip install jupyterhub-ldap-authenticator
1 < DL>
ldapauthenticator.bind_user_密码
用于简单绑定的用户密码(默认为无)。
pip install jupyterhub-ldap-authenticator
2 < DL>
ldapauthenticator.用户搜索库
目录信息树中用户搜索开始的位置。
pip install jupyterhub-ldap-authenticator
3 < DL>
ldapauthenticator.用户搜索过滤器
LDAP搜索筛选器,以验证组织中是否存在身份验证用户。包含{username}的搜索筛选器将用验证用户的用户名替换该值。
pip install jupyterhub-ldap-authenticator
4 < DL>< Dt>ldapauthenticator.user_membership_属性
用于关联用户组成员身份的LDAP属性(默认为"memberof"。
pip install jupyterhub-ldap-authenticator
5 < DL>
ldapauthenticator.group\u搜索库
目录信息树中开始组搜索的位置。 包含{group}的搜索字符串将替换为来自 允许的组
pip install jupyterhub-ldap-authenticator
6 < DL>
ldapauthenticator.group_search_过滤器
ldap search filter返回allowed\u groups参数中定义的组的成员。包含{group}的搜索筛选器将用allowed\groups参数中提供的组dns替换该值。
pip install jupyterhub-ldap-authenticator
7 < DL>
ldapauthenticator.允许的组
要授予用户登录权限,用户必须是其成员的LDAP组DNS列表。如果未定义或设置为"无",则允许的组将短路,所有用户都将被允许(默认为"无"。
pip install jupyterhub-ldap-authenticator
8 < DL>
ldapauthenticator.允许嵌套组
布尔值,允许在 允许的组(默认为false)。
pip install jupyterhub-ldap-authenticator
9 < DL>
ldapauthenticator.username_模式
所有有效用户名都必须匹配的正则表达式模式。如果用户名 与此处指定的模式不匹配,将不尝试身份验证。 如果未设置,则允许任何用户名(默认为无)。
c.JupyterHub.authenticator_class='ldapauthenticator.LDAPAuthenticator'
0 < DL>
ldapauthenticator.创建用户目录
布尔值,允许在登录时创建用户主目录
c.JupyterHub.authenticator_class='ldapauthenticator.LDAPAuthenticator'
1 < DL>
ldapauthenticator.create_user_home_dir_命令
将用户主目录创建为字符串列表时使用的命令。为了 列表中的每个元素,字符串用户名将替换为用户的 用户名。用户名也将作为最终参数追加。默认值 到Linux系统上的"mkhomedir\u helper"。
c.JupyterHub.authenticator_class='ldapauthenticator.LDAPAuthenticator'
2

示例

FreeIPA集成
c.JupyterHub.authenticator_class='ldapauthenticator.LDAPAuthenticator'
3
活动目录集成
c.JupyterHub.authenticator_class='ldapauthenticator.LDAPAuthenticator'
4
OpenLDAP集成

由于openldap本身不支持其用户对象中的memberof属性,因此在下面的示例中,允许的组作用域被短路:

c.JupyterHub.authenticator_class='ldapauthenticator.LDAPAuthenticator'
5

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java无法调用扩展超级非抽象类的抽象类方法   java Hibernate 5关联[]引用了一个未映射的实体[]:origin(User.hbm.xml)   java禁用JSpinner中的数字分组   java Spring的环境抽象是否使用PropertyEditor?   java是否创建自定义注释作为FrameworkAnnotation的别名?   java如何将Selenium安装为Unix守护程序?   java三值if运算符在正则if-one中   有人能帮我在一个程序上分析java代码吗?   java Spring集成5.0反应堆类型支持   java Websphere 7线程转储分析   java Akka期货和监管策略如何应对失败   使用Clojure中的可选参数调用java函数的构造函数   java如何消除安卓按钮的延迟?   Android上使用X.509证书的java认证应用程序   java如何获取列表中特定类型的所有对象?   java如何将json数组字符串转换为json对象   安卓 Java从长时间返回的日期不正确   java Android Studio在尝试从TextEdit搜索单词时崩溃   ViewPager的java子项