routes.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:do-portal 作者: certeu 项目源码 文件源码
def _ldap_authenticate(username, password):
    """Performs a search bind to authenticate a user.

    LDAP server details are defined in :doc:`config`.

    :param username: LDAP username
    :param password: LDAP password
    :return: Returns a tuple of user_info and authentication status
    :rtype: tuple
    """
    user = ldap3_manager.get_user_info_for_username(username)
    ldap_auth = ldap3_manager.authenticate_search_bind(username, password)
    if ldap_auth.status is AuthenticationResponseStatus.success:
        authenticated = True
    else:
        authenticated = False

    return user, authenticated
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号