This commit is contained in:
Matvey Aksenov 2015-04-11 16:59:41 +00:00
parent 1474efefd4
commit 7956927730

View File

@ -112,7 +112,7 @@ $ cabal install ldap-haskell/ldap-haskell.cabal</pre>
<p> <p>
Before all that, though, here's the obligatory module header Before all that, though, here's the obligatory module header
describing the language extensions and imports used later, describing the language extensions and imports used later,
so you can follow along: so that you can follow along:
</p> </p>
<pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">{-# LANGUAGE OverloadedStrings #-}</span> <pre class="sourceCode literate haskell"><code class="sourceCode haskell"><span class="ot">{-# LANGUAGE OverloadedStrings #-}</span>
@ -123,7 +123,7 @@ $ cabal install ldap-haskell/ldap-haskell.cabal</pre>
<h3>LDAP Authentication</h3> <h3>LDAP Authentication</h3>
<p> <p>
The typical LDAP authentication routine has three steps. The typical LDAP authentication routine has three steps:
<ol> <ol>
<li>Try and bind with the manager's DN and password. Manager here means <li>Try and bind with the manager's DN and password. Manager here means
any account that is able to look up information in the Directory. any account that is able to look up information in the Directory.
@ -133,7 +133,7 @@ $ cabal install ldap-haskell/ldap-haskell.cabal</pre>
</p> </p>
<p> <p>
We will encapsulate the first two steps in a separate function as it is a We will encapsulate the first two steps in a separate function as it's a
fairly self-contained operation: fairly self-contained operation:
</p> </p>
@ -151,8 +151,8 @@ findUser l (managerDn, managerPassword) userName <span class="fu">=</span> <span
<!-- end findUser --> <!-- end findUser -->
<p> <p>
The third step uses the <code>Dn</code>; we will pass it through since The third step uses the <code>Dn</code> we've got from <code>findUser</code>; we will
it will be useful to <code>changePassword</code>. pass it through since it will be useful to <code>changePassword</code>.
</p> </p>
<!-- start login --> <!-- start login -->
@ -165,10 +165,6 @@ login l (managerDn, managerPassword) (userName, userPassword) <span class="fu">=
return userDn</code></pre> return userDn</code></pre>
<!-- end login --> <!-- end login -->
<p>
In the real code you will, obviously, use something better than <code>error</code>.
</p>
<h3>Changing user's password</h3> <h3>Changing user's password</h3>
<p> <p>