convert shiny ldap authentication to flask ldap authentication

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-16 05:57:09

问题


We have shiny application which use ldap authentication from Microsoft Active Directory, which is as follows

auth_active_dir ldap://52.324.23.53/dc=x,dc=y,dc=z x.y.z{

        #user_bind_template  "{username}";

}

This code works properly. I have flask app. I want same LDAP authentication for flask app using following code

import ldap 
url = 'ldap://52.324.23.53'
l = ldap.initialize(url)
l.set_option(ldap.OPT_REFERRALS, 0)
l.simple_bind_s('MyUserName', 'MyAnswer')

However following is error code, when I ran code in same machine.

{'info': '80090308: LdapErr: DSID-0C0903D9, comment: AcceptSecurityContext error, data 52e, v2580', 'desc': 'Invalid credentials'}

What I am doing wrong ? My UserName and Password I used are same one both places. Shiny Accepts UserName and Password. But flask throws error.

来源:https://stackoverflow.com/questions/40819180/convert-shiny-ldap-authentication-to-flask-ldap-authentication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!