<?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=331" />

<title>Yubico Forum</title>
<subtitle>...visit our web-store at</subtitle>
<link href="https://forum.yubico.com/index.php" />
<updated>2009-06-05T06:43:23+01:00</updated>

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=5&amp;t=331</id>
<entry>
<author><name><![CDATA[masa]]></name></author>
<updated>2009-06-05T06:43:23+01:00</updated>
<published>2009-06-05T06:43:23+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=331&amp;p=1489#p1489</id>
<link href="https://forum.yubico.com/viewtopic.php?t=331&amp;p=1489#p1489"/>
<title type="html"><![CDATA[Re: Inserting yubikeys into MySQL db used by yubikey-server-j]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=331&amp;p=1489#p1489"><![CDATA[
Thank you for the detailed answer! <br /><br />Basically Tomcat is now working, but there are still some problems. The biggest one is that the Tomcat seems to accept valid OTP input with any (existing) id with it.<br /><br />I mean that if I first try:<br /><br /><!-- m --><a class="postlink" href="http://localhost:8080/wsapi/verify?id=1&amp;otp=fefhhlecdkgttrdtvigvhdhvdvuiujedeujicuketgnt">http://localhost:8080/wsapi/verify?id=1 ... jicuketgnt</a><!-- m --><br /><br />And the answer is &quot;status=OK&quot;. After that I try:<br /><br /><!-- m --><a class="postlink" href="http://localhost:8080/wsapi/verify?id=4&amp;otp=fefhhlecdkgttrdtvigvhdhvdvuiujedeujicuketgnt">http://localhost:8080/wsapi/verify?id=4 ... jicuketgnt</a><!-- m --><br /><br />And will get answer &quot;status=RELAYED_OTP&quot;. Notice that id change 1 -&gt; 4. If I get new otp from yubikey and try to use it with id 4 I will get &quot;status=OK&quot;!<br /><br />Below is output from my yubikeys table:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">mysql&gt; select * from yubikeys;<br />+----+-----------+--------+---------------------+---------------------+----------+--------+--------------------------+---------+-------+------+----------------+----------+------------+<br />| id | client_id | active | created             | accessed            | tokenId  | userId | secret                   | counter | low   | high | notes          | serial   | sessionUse |<br />+----+-----------+--------+---------------------+---------------------+----------+--------+--------------------------+---------+-------+------+----------------+----------+------------+<br />|  1 |         1 |      1 | 2009-06-04 12:49:02 | 2009-06-04 23:19:29 | Q0ZqMCld | 1      | QyJpOFR7aj9abS87NnBkcg== |       9 | 27302 |  152 | Root admin key | 00001001 |         27 |<br />|  4 |         4 |      1 | 2007-10-03 16:11:50 | 2009-06-04 22:58:58 | KkQ5Rydv | joo    | KkQ5RydvWkxVOXhwJHM0Jg== |       6 | 12527 |  243 | ghost          | 00001002 |          6 |<br />+----+-----------+--------+---------------------+---------------------+----------+--------+--------------------------+---------+-------+------+----------------+----------+------------+<br />2 rows in set (0.00 sec)<br /></div><p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=663">masa</a> — Fri Jun 05, 2009 6:43 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[network-marvels]]></name></author>
<updated>2009-06-04T12:05:36+01:00</updated>
<published>2009-06-04T12:05:36+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=331&amp;p=1487#p1487</id>
<link href="https://forum.yubico.com/viewtopic.php?t=331&amp;p=1487#p1487"/>
<title type="html"><![CDATA[Re: Inserting yubikeys into MySQL db used by yubikey-server-j]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=331&amp;p=1487#p1487"><![CDATA[
We downloaded and installed the latest Java validation server in our test environment. <br />We have performed the following steps:<br /><br /><ul>1) We downloaded the latest Yubico Java validation server source code from the following link:<br /><br /><!-- m --><a class="postlink" href="http://code.google.com/p/yubikey-server-j/source/checkout">http://code.google.com/p/yubikey-server ... e/checkout</a><!-- m --> <br /><br />We complied the source code using &quot;ant&quot; and placed it into the &quot;webapps&quot; directory of Tomcat and restarted the &quot;tomcatd&quot; demon.<br /><br />2) We created the Yubico database using the database schema available at the following link:<br /><br /><!-- l --><a class="postlink-local" href="http://forum.yubico.com/yubico-val-server/db.htm">yubico-val-server/db.htm</a><!-- l --><br /><br />The database schema is incomplete and we had to create an extra column called &quot;sessionUse&quot; using the following SQL command:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">mysql&gt; alter table yubikeys add column sessionUse varchar(60); <br /></div><br />3) We programmed a YubiKey using the YubiKey ID and AES Key mentioned in the above forum post. The programmed YubiKey is now emitting the following OTP:<br /><br />fefhhlecdkgtrkbhcckiucjdccfturhfrhrgfgnghhve<br />fefhhlecdkgtcegkcfflhjthefrijrhkiltcjulrruvu<br /><br />4) We populated the database using the following insert command:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">insert into  yubikeys (client_id, tokenId, secret, created, accessed) VALUES ('1', 'Q0ZqMCld','QyJpOFR7aj9abS87NnBkcg==',now(),now());<br /></div><br /><em>Please note that we need to convert the hex encoded YubiKey ID and AES key into Base64 encoded format before inserting into the Yubico database. </em><br /><br />The database schema already populated the clients table as follows:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">mysql&gt; select * from clients;<br />+----+---------+--------+---------------------+-----------------+------------------------------+<br />| id | perm_id | active | created             | email           | secret                       |<br />+----+---------+--------+---------------------+-----------------+------------------------------+<br />|  1 |       1 |      1 | 1970-01-01 00:00:00 | root@my_org.com | TWIWuqIJKVWhXPbVuxEiHv5GSA0= |<br />+----+---------+--------+---------------------+-----------------+------------------------------+<br /></div><br />5) We then restarted the &quot;tomcatd&quot; demon and tested the OTP validation using the following URL:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">http://&lt;Tomcat server IP address&gt;:8080/wsapi/verify?id=1&amp;otp=fefhhlecdkgtildhhnuhugittrrdrinrjlkvegbeulji<br /></div><br />and received the following result:<br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">h=OaWfWk3ZtmpxAxxV23D2ecmbrNw=<br />t=2009-03-04T15:30:37Z0064<br />status=OK<br /></div> <br /></ul>We hope that after following the steps given above you will be able to successfully validate the OTP. If you are facing any further issues, please post those issues along with your Yubico database dump and the &quot;catalina.out&quot; log file.<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=280">network-marvels</a> — Thu Jun 04, 2009 12:05 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[masa]]></name></author>
<updated>2009-06-04T07:46:30+01:00</updated>
<published>2009-06-04T07:46:30+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=331&amp;p=1485#p1485</id>
<link href="https://forum.yubico.com/viewtopic.php?t=331&amp;p=1485#p1485"/>
<title type="html"><![CDATA[Inserting yubikeys into MySQL db used by yubikey-server-j]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=331&amp;p=1485#p1485"><![CDATA[
Hello,<br /><br />I'm trying to install own yubikey-server-j. Tomcat is up and running and I can try validation at:<br /><br /><!-- m --><a class="postlink" href="http://localhost:8080/wsapi/verify?id=1&amp;otp=">http://localhost:8080/wsapi/verify?id=1&amp;otp=</a><!-- m -->[OTP HERE]<br /><br />The problem is that every time it only responds something like:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">t=2009-06-04T09:20:22Z0022<br />status=BAD_OTP<br />h=Da7CDoffvd1g1Q0sHPYKohh5C8c=<br /></div><br /><br />For testing I have reprogrammed one yubikey using Yubico Configuration Utility.<br /><br />The reprogrammed yubikey which I'm using for testing has the following details:<br /><br />Yubikey ID: 43466a30295d<br />Yubico AES key: 43226938547b6a3f5a6d2f3b36706472<br /><br />I have used the following MySQL query to insert that yubikeys' details into database (yubikeys table):<br /><br />INSERT INTO yubikeys (client_id, tokenId, secret, created, accessed)  <br />VALUES('1', 'NDM0NjZhMzAyOTVk','NDMyMjY5Mzg1NDdiNmEzZjVhNmQyZjNiMzY3MDY0NzI=','now()','now()');<br /><br />I'm not sure if those values are correct or not?<br /><br />I also need to know what to insert into clients table.<br /><br />I think that the &quot;BAD_OTP&quot; is caused by some bad values in the yubikeys insert, possible wrong encoded values or some other things. So I need detailed explanation what to insert in those &quot;yubikeys&quot; and &quot;clients&quot; tables to get validation working.<br /><br />Thank you in advance!<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=663">masa</a> — Thu Jun 04, 2009 7:46 am</p><hr />
]]></content>
</entry>
</feed>