<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 4, 2015 at 4:38 PM, Michael Dahlberg <span dir="ltr">&lt;<a href="mailto:olgamirth@gmail.com" target="_blank">olgamirth@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I was just doing the ldapsearch to confirm that I could bind to AD server, authenticate as the service user, and then get something back.  My understanding of the way authentication takes place using LDAP against an AD server is that in step 1, a user with the permissions to query the database binds to the database and then queries it to see if the user who wants to authenticate is a valid user. If so, step 2, the user binds to the database, authenticates, and if successful retrieves his/her available attributes.  I&#39;m not sure how to craft that particular set of steps using ldapsearch.  Can you suggest such a query?</div><div><br></div></div></div></div></blockquote><div><br></div><div>An important detail in step 1 is that the user&#39;s LDAP DN is retrieved as part of that query. That is what is used to perform the bind in step 2.</div><div>Try this query:</div><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px">ldapsearch -x -D &quot;</span><a href="mailto:servicename@bucknell.edu" target="_blank" style="font-size:12.8000001907349px">servicename@bucknell.edu</a><span style="color:rgb(80,0,80);font-size:12.8000001907349px">&quot; -b &quot;</span><span style="font-size:12.8000001907349px">cn=Users,dc=bucknell,</span><span style="font-size:12.8000001907349px">dc=edu</span><span style="color:rgb(80,0,80);font-size:12.8000001907349px">&quot; -s one -H ldap://</span><a href="http://xxxxx.bucknell.edu/" target="_blank" style="font-size:12.8000001907349px">XXXXX.bucknell.edu</a><span style="color:rgb(80,0,80);font-size:12.8000001907349px"> -W &#39;(sAMAccountName=USERNAME)&#39; 1.1</span></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>Also, wouldn&#39;t the referrals occur while retrieving attributes, not while doing the authentication?</div></div></div></div></blockquote><div><br></div><div>I&#39;m assuming the referrals occur during DN resolution.</div><div><br></div><div>--Daniel Fisher</div><div><br></div></div></div></div>