<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi All,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have successfully installed following :<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Pip freeze output :<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Django==1.6.5<o:p></o:p></p>
<p class="MsoNormal">cx-Oracle==5.1.3<o:p></o:p></p>
<p class="MsoNormal">django-auth-ldap==1.2.0 ( I think I don’t need this – Please confirm )<o:p></o:p></p>
<p class="MsoNormal">pyasn1==0.1.7<o:p></o:p></p>
<p class="MsoNormal">python3-ldap==0.9.5<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">From Python shell I do following in the sequence :<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">from ldap3 import Server, Connection, AUTH_SIMPLE, STRATEGY_SYNC, STRATEGY_ASYNC_THREADED, SEARCH_SCOPE_WHOLE_SUBTREE, GET_ALL_INFO<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">s = Server(‘Our LDAP server', port = 636, use_ssl = True, get_info = GET_ALL_INFO)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">c = Connection(s, auto_bind = True, client_strategy = STRATEGY_SYNC, user=<My user name>, password=<My Password>, authentication=AUTH_SIMPLE, check_names=True)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Connection fails with invalid credentials error but after I execute connection command, I get s.info showing me all server details.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My windows/network admin tells me following :<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">It does look like you’re are connecting to the LDAP server and querying basic information.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Typically I look for a couple things in a configuration file to make sure it binds properly (authenticated).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="font-family:Symbol;color:#1F497D">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">        
</span><span style="color:#1F497D">Server name - OK<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="font-family:Symbol;color:#1F497D">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">        
</span><span style="color:#1F497D">Port<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.0in;text-indent:-.25in"><span style="font-family:"Courier New";color:#1F497D">o</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">  
</span><b><span style="color:#1F497D">636</span></b><span style="color:#1F497D"> (SSL)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.0in;text-indent:-.25in"><span style="font-family:"Courier New";color:#1F497D">o</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">  
</span><span style="color:#1F497D">I see you have this already<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="font-family:Symbol;color:#1F497D">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">        
</span><span style="color:#1F497D">Base DN<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.0in;text-indent:-.25in"><span style="font-family:"Courier New";color:#1F497D">o</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">  
</span><b><span style="color:#1F497D">DC=CRUSSE,DC=local</span></b><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.0in;text-indent:-.25in"><span style="font-family:"Courier New";color:#1F497D">o</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">  
</span><span style="color:#1F497D">Even though it’s querying the default naming context, typically you have to specify this information in your configuration file or connection string.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="font-family:Symbol;color:#1F497D">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">        
</span><span style="color:#1F497D">Username Attribute<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.0in;text-indent:-.25in"><span style="font-family:"Courier New";color:#1F497D">o</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">  
</span><b><span style="color:#1F497D">sAMAccountName</span></b><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.0in;text-indent:-.25in"><span style="font-family:"Courier New";color:#1F497D">o</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">  
</span><span style="color:#1F497D">Because LDAP isn’t always Active Directory you typically have to specify what the attribute is for the username.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="font-family:Symbol;color:#1F497D">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">        
</span><span style="color:#1F497D">Bind User DN<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.0in;text-indent:-.25in"><span style="font-family:"Courier New";color:#1F497D">o</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">  
</span><b><span style="color:#1F497D">CN=Abhay Mannur,OU=Users,OU=IT,OU=San Francisco,OU=Sites,OU=Charlotte Russe,DC=CRUSSE,DC=local<o:p></o:p></span></b></p>
<p class="MsoListParagraph" style="margin-left:1.0in;text-indent:-.25in"><span style="font-family:"Courier New";color:#1F497D">o</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">  
</span><span style="color:#1F497D">Typically we enter in a service account here, but you can use your credentials for now.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in"><span style="font-family:Symbol;color:#1F497D">·</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">        
</span><span style="color:#1F497D">Bind User Password<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.0in;text-indent:-.25in"><span style="font-family:"Courier New";color:#1F497D">o</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">  
</span><span style="color:#1F497D">********<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.0in;text-indent:-.25in"><span style="font-family:"Courier New";color:#1F497D">o</span><span style="font-size:7.0pt;font-family:"Times New Roman","serif";color:#1F497D">  
</span><span style="color:#1F497D">Your AD password<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">It looks like you may be missing the username attribute and/or not entering in the full bind DN.  Again, the bind User DN would typically be a service account.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Is there a configuration file anywhere or is everything just getting specified as a parameter when connecting?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m totally lost with as doing LDAP authentication for the first time.<o:p></o:p></p>
<p class="MsoNormal">Please help me with this configuration and/or my connection object parameters etc.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:#1F497D">Abhay Mannur<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="color:#1F497D">Programmer Analyst III<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#0070C0">abhay.mannur@charlotterusse.com<o:p></o:p></span></p>
<p class="MsoNormal">Office : 415-820-6541<o:p></o:p></p>
<p class="MsoNormal">Cell : 415-279-9565<o:p></o:p></p>
<p class="MsoNormal"><img width="124" height="50" id="Picture_x0020_1" src="cid:image001.jpg@01CFB560.6211B810" alt="cid:image001.jpg@01CEC9C0.04FD8370"><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>