跳转到主要内容

为hug提供基于LDAP的身份验证支持

项目描述

hug_authentication_ldap

PyPI version Build Status Coverage Status License Join the chat at https://gitter.im/timothycrosley/hug

为hug提供易于使用的基于LDAP的身份验证支持

import hug
import hug_authentication_ldap


authentication = hug_authentication_ldap.basic('myldap.server.net', 'uid={user_name},ou=people')


@hug.get(requires=authentication)
def say_hello(hug_user):
    return 'Hello {}!'.format(hug_user.name)

或者,为hug内部通用的可重用LDAP密码验证

import hug
import hug_authentication_ldap


ldap_check = hug_authentication_ldap.verify('myldap.server.net', 'uid={user_name},ou=people')


@hug.get()
def check(user_name, password):
    if ldap_check(user_name, password):
        return True

    return False

安装hug_authentication_ldap

安装hug_authentication_ldap非常简单,就像

pip3 install hug_authentication_ldap --upgrade

理想情况下,在虚拟环境中。

什么是hug_authentication_ldap?

为hug提供基于LDAP的身份验证支持的扩展


感谢您,并希望您觉得hug_authentication_ldap有帮助!

~Timothy Crosley

项目详情


下载文件

为您的平台下载文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码发行版

hug_authentication_ldap-1.0.3.tar.gz (4.0 kB 查看散列)

上传时间: 源代码

支持者