<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="https://forum.yubico.com/feed.php?f=5&amp;t=455" />

<title>Yubico Forum</title>
<subtitle>...visit our web-store at</subtitle>
<link href="https://forum.yubico.com/index.php" />
<updated>2010-01-11T21:27:44+01:00</updated>

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=5&amp;t=455</id>
<entry>
<author><name><![CDATA[dave_marsh_pw]]></name></author>
<updated>2010-01-11T21:06:36+01:00</updated>
<published>2010-01-11T21:06:36+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=455&amp;p=1956#p1956</id>
<link href="https://forum.yubico.com/viewtopic.php?t=455&amp;p=1956#p1956"/>
<title type="html"><![CDATA[Re: PAM user/yubikey mapping in LDAP]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=455&amp;p=1956#p1956"><![CDATA[
Server Information that is typically requested:<br /><br />1) OS: Ubuntu 9.10<br />2) Yubico PAM Version: 2.2<br />3) LDAP: 2.4.18<br />4) /etc/pam.d/RADIUSD<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">auth required /lib/security/pam_yubico.so id=1 key=eraser debug url=http://localhost/yubico/val/verify?id=%d&amp;otp=%s ldapserver=127.0.0.1 ldapdn=ou=people,dc=pwturbolink,dc=com user_attr=cn yubi_attr=yubikeyid<br />        <br />@include common-auth<br />@include common-account<br />@include common-password<br />@include common-session<br /></div><br /><br />5) Installed my own validation server<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=949">dave_marsh_pw</a> — Mon Jan 11, 2010 9:06 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[dave_marsh_pw]]></name></author>
<updated>2010-01-11T21:27:44+01:00</updated>
<published>2010-01-11T21:04:15+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=455&amp;p=1954#p1954</id>
<link href="https://forum.yubico.com/viewtopic.php?t=455&amp;p=1954#p1954"/>
<title type="html"><![CDATA[PAM user/yubikey mapping in LDAP]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=455&amp;p=1954#p1954"><![CDATA[
I did a quick search and didn't see any existing topics I could post this in.<br /><br />I'm using the PAM module along with Radius and LDAP to authenticate users on a VPN.  Radius is configured to use the Linux PAM system.  <br /><br />The Radius PAM entry is configured to use two factor authentication (unix_password + otp).  This is done by using the yubico PAM to authenticate the OTP, then passing the remainder of the password to common-auth which checks with LDAP.  The username/yubikeyid mapping is done with an authfile.<br /><br />This all works just fine.  <br /><br />I ran into trouble when I tried to move the mapping into LDAP.  Upon specifying the required parameters (ldapserver, ldapdn, user_attr, yubi_attr) the authentication failed and my log file contained the following:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">&#91;pam_yubico.c:pam_sm_authenticate(541)&#93; ykclient return value (0): Success<br />&#91;pam_yubico.c:authorize_user_token_ldap(255)&#93; ldap-dn: cn=mytest,ou=people,dc=pwturbolink,dc=com<br />&#91;pam_yubico.c:authorize_user_token_ldap(256)&#93; ldap-filter: (yubikeyid=*)<br />&#91;pam_yubico.c:authorize_user_token_ldap(262)&#93; ldap_search_ext_s: No such object<br />&#91;pam_yubico.c:pam_sm_authenticate(568)&#93; Yubikey not authorized to login as user<br />&#91;pam_yubico.c:pam_sm_authenticate(583)&#93; done. &#91;Authentication service cannot retrieve authentication info&#93;<br /></div><br /><br />The <em>ldap_search_ext_s: No such object</em> error indicates that it authenticated and performed a search just fine and came back with nothing.  Upong inserting the same search criteria into a python script I wrote for testing, I received the same results.<br /><br />I began to play around and noticed that if I used the following criteria, I was able to retrieve the necessary data: <br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">baseDN = &quot;ou=people,dc=pwturbolink,dc=com&quot;<br />searchFilter = &quot;(&amp;(cn=mytest)(yubikeyid=*))&quot;<br /></div><br /><br />I rewrote the <em>authorize_user_token_ldap</em> to reflect these changes and did not receive an error from <em>ldap_search_ext_s</em>.  I was about to rewrite the code the parses that results when I realized this probably isn't the way to go.<br /><br />Does anybody else have the mapping stored in LDAP working &quot;out of the box&quot;?  Have I mis-configured LDAP somehow?<br /><br /><br />EDIT:  I almost forgot.  My very first attempt yielded a &quot;Protocol Error&quot; from <em>ldap_simple_bind_s</em>.  I had to add the following lines to move past it:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">int ldap_version = LDAP_VERSION3;<br /><br />&lt;after the call to ldap_init&gt;<br /><br />ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &amp;ldap_version); <br /><br /></div><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=949">dave_marsh_pw</a> — Mon Jan 11, 2010 9:04 pm</p><hr />
]]></content>
</entry>
</feed>