问题
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