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

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

<author><name><![CDATA[Yubico Forum]]></name></author>
<id>https://forum.yubico.com/feed.php?f=5&amp;t=394</id>
<entry>
<author><name><![CDATA[quocbinhsg]]></name></author>
<updated>2010-11-01T18:47:09+01:00</updated>
<published>2010-11-01T18:47:09+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=394&amp;p=2420#p2420</id>
<link href="https://forum.yubico.com/viewtopic.php?t=394&amp;p=2420#p2420"/>
<title type="html"><![CDATA[Re: Tutorial: Deploying Java Validation Server on Glassfish]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=394&amp;p=2420#p2420"><![CDATA[
<div class="quotetitle">FloAtFokus wrote:</div><div class="quotecontent"><br />5. SETUP YUBIKEY JAVA VALIDATION SERVER<br />Launch your browser and go to <!-- m --><a class="postlink" href="http://code.google.com/p/yubikey-server-j/">http://code.google.com/p/yubikey-server-j/</a><!-- m -->.<br />Switch to the source tab and check out the files provided by the svn.<br />Run eclipse (or your favourite Java Dev Tool).<br />New Java Project / Create Project from existing source / select the directory just checked out<br />Now you will see a warning: &quot;base.jar is missing&quot;. <br />Right mouse click on the project / Build Path / Configure Build Path.<br />Remove the base.jar.<br />Add jars... / select your project / resources / yubico-base-1.1.jar / Ok<br />Go to the src package and open the file &quot;web.xml&quot;.<br />Configure your MySQL db_user, db_password and db_url (e.g. &quot;jdbc:mysql://:3306/yubico?autoReconnect=true&quot;).<br />The next step is a little bit weird but it caused an error on my glassfish (&quot;The content of element type &quot;servlet&quot; must match...&quot;):<br />Thus you need to change this. You have to do this for both servlet nodes in the web.xml: Cut the line &quot;&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;&quot; out of the servlet node and paste it beneath the last init-param of the same servlet node.<br /><br />6. EXPORT YUBIKEY SERVER TO GLASSFISH<br />In eclipse right mouse click on build.xml / Run as / Ant build...<br />This will generate a file named &quot;wsapi.war&quot; in the &quot;out&quot; directory of your project.<br />Launch your Glassfish Admin Console in a browser (<!-- m --><a class="postlink" href="http://localhost:4848/">http://localhost:4848/</a><!-- m -->) and go to Applications / Web Applications.<br />Deploy / select the &quot;wsapi.war&quot; you've just created / Ok<br />Launch your favourite browser and go to <!-- 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 --><br />Put your finger on the Yubikey USB token. At the moment this will cause an error because we have to create and fill the MySQL database first.<br /></div><br /><br />I download wsapi.war and open it with Eclipse. So I edit web.xml as you describle. But GlassFish still show error:<br /><br />Exception while deploying the app : java.io.IOException: org.xml.sax.SAXParseException: The content of element type &quot;servlet&quot; must match &quot;(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),init-param*,load-on-startup?,run-as?,security-role-ref*)&quot;.<br /><br />Can you help me?<br /><br />Regards!<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=1417">quocbinhsg</a> — Mon Nov 01, 2010 6:47 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[network-marvels]]></name></author>
<updated>2009-08-27T16:47:47+01:00</updated>
<published>2009-08-27T16:47:47+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=394&amp;p=1718#p1718</id>
<link href="https://forum.yubico.com/viewtopic.php?t=394&amp;p=1718#p1718"/>
<title type="html"><![CDATA[Re: Tutorial: Deploying Java Validation Server on Glassfish]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=394&amp;p=1718#p1718"><![CDATA[
Thank you for posting the detailed step by step guide !!!<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=280">network-marvels</a> — Thu Aug 27, 2009 4:47 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[FloAtFokus]]></name></author>
<updated>2009-08-27T16:40:00+01:00</updated>
<published>2009-08-27T16:40:00+01:00</published>
<id>https://forum.yubico.com/viewtopic.php?t=394&amp;p=1717#p1717</id>
<link href="https://forum.yubico.com/viewtopic.php?t=394&amp;p=1717#p1717"/>
<title type="html"><![CDATA[Tutorial: Deploying Java Validation Server on Glassfish]]></title>

<content type="html" xml:base="https://forum.yubico.com/viewtopic.php?t=394&amp;p=1717#p1717"><![CDATA[
This tutorial will focus on the yubikey server. Thus, I will not go into the details of Glassfish/MySQL Setup.<br /><br />1. DOWNLOAD YUBIKEY CONFIGURATION TOOL<br />First of all modify your Yubikey since we are not able to read the AES128 of our Yubikey. Keep in mind that you can't login to services from Yubico once you modified your Yubikey until you uploaded your modified Yubikey data to Yubico here: <!-- m --><a class="postlink" href="http://www.yubico.com/developers/aeskeys/">http://www.yubico.com/developers/aeskeys/</a><!-- m --><br />Download and install personalization tool. There is a binary version for Windows. <br /><!-- m --><a class="postlink" href="http://www.yubico.com/developers/personalization/">http://www.yubico.com/developers/personalization/</a><!-- m --><br /><br />2. MODIFY YOUR YUBIKEY<br />Run the application &quot;Yubico Configuration Utility&quot; from Start Menu.<br />Select: &quot;Create a dynamic Yubikey Configuration (OTP mode)&quot;<br />Use a public identity<br />Desired Length: 6<br />Public ID String: ff 50 7d b6 68 de (I will use this example value in the tutorial but you can choose any other value)<br />Fixed Value<br />NEXT<br />Do not use a private identity<br />NEXT<br />AES Key: e1 6e 6e c2 5c 31 46 94 01 9e 44 40 ff c3 43 3b <br />NEXT<br />Output Format Flags: Send ENTER as the last keystroke<br />NEXT<br />The yubikeys are currently unprotected and I want to keep it that way<br />NEXT<br />Write to configuration 1<br />RUN<br />Close the application<br /><br />3. SETUP LOCAL GLASSFISH SERVER<br />Download Glassfish Server from sun:<br /><!-- m --><a class="postlink" href="https://glassfish.dev.java.net/public/downloadsindex.html">https://glassfish.dev.java.net/public/d ... index.html</a><!-- m --><br />Unzip and run setup.xml with ant.<br />Start Glassfish Server: &quot;asadmin start-domain domain1&quot;.<br />Launch your browser and go to <!-- m --><a class="postlink" href="http://localhost:8080/">http://localhost:8080/</a><!-- m --> to see if it's running.<br />Go to <!-- m --><a class="postlink" href="http://localhost:4848/">http://localhost:4848/</a><!-- m --> (default name: admin / default pass: adminadmin) to open the configuration.<br /><br />4. SETUP MYSQL FOR GLASSFISH<br />Download and install MySQL.<br />Download and install JDBC Connector as described in here:<br /><!-- m --><a class="postlink" href="http://www.albeesonline.com/blog/2008/08/06/creating-and-configuring-a-mysql-datasource-in-glassfish-application-server/">http://www.albeesonline.com/blog/2008/0 ... on-server/</a><!-- m --><br /><br />5. SETUP YUBIKEY JAVA VALIDATION SERVER<br />Launch your browser and go to <!-- m --><a class="postlink" href="http://code.google.com/p/yubikey-server-j/">http://code.google.com/p/yubikey-server-j/</a><!-- m -->.<br />Switch to the source tab and check out the files provided by the svn.<br />Run eclipse (or your favourite Java Dev Tool).<br />New Java Project / Create Project from existing source / select the directory just checked out<br />Now you will see a warning: &quot;base.jar is missing&quot;. <br />Right mouse click on the project / Build Path / Configure Build Path.<br />Remove the base.jar.<br />Add jars... / select your project / resources / yubico-base-1.1.jar / Ok<br />Go to the src package and open the file &quot;web.xml&quot;.<br />Configure your MySQL db_user, db_password and db_url (e.g. &quot;jdbc:mysql://:3306/yubico?autoReconnect=true&quot;).<br />The next step is a little bit weird but it caused an error on my glassfish (&quot;The content of element type &quot;servlet&quot; must match...&quot;):<br />Thus you need to change this. You have to do this for both servlet nodes in the web.xml: Cut the line &quot;&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;&quot; out of the servlet node and paste it beneath the last init-param of the same servlet node.<br /><br />6. EXPORT YUBIKEY SERVER TO GLASSFISH<br />In eclipse right mouse click on build.xml / Run as / Ant build...<br />This will generate a file named &quot;wsapi.war&quot; in the &quot;out&quot; directory of your project.<br />Launch your Glassfish Admin Console in a browser (<!-- m --><a class="postlink" href="http://localhost:4848/">http://localhost:4848/</a><!-- m -->) and go to Applications / Web Applications.<br />Deploy / select the &quot;wsapi.war&quot; you've just created / Ok<br />Launch your favourite browser and go to <!-- 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 --><br />Put your finger on the Yubikey USB token. At the moment this will cause an error because we have to create and fill the MySQL database first.<br /><br />7. CONFIGURE MYSQL DATABASE FOR YUBIKEY JAVA SERVER<br />This page provides a guide for the MySQL tables: <!-- l --><a class="postlink-local" href="http://forum.yubico.com/yubico-val-server/db.htm">yubico-val-server/db.htm</a><!-- l --><br />I prefer GUI tools such as MySQL Administrator or PhpMyAdmin but you can use normal command line as well.<br />You should have a databse named &quot;yubico&quot; in your local MySQL.<br />Execute these queries on your MySQL database: <!-- l --><a class="postlink-local" href="http://forum.yubico.com/yubico-val-server/db_schema.sql">yubico-val-server/db_schema.sql</a><!-- l --><br />Unfortunately the &quot;yubikeys&quot; table misses a column named &quot;sessionUse&quot;, thus we need to add it with the following query:<br />alter table yubikeys add column sessionUse varchar(60);<br /><br />8. INSERT YOUR YUBIKEY INTO DATABASE<br />In step 2 we reprogrammed our Yubikey. Now we need to insert those values into the &quot;yubikey&quot; table of our database. But first of all the public ID and the AES128 key must be converted into Base64.<br />Search for a Hexa --&gt; Base64 Converter in Google (I like this one: <!-- m --><a class="postlink" href="http://home2.paulschou.net/tools/xlate/">http://home2.paulschou.net/tools/xlate/</a><!-- m -->)<br />Attention: Do not convert from String to Base64 (ZmY1MDdkYjY2OGRl is NOT a valid Base64 encoding for the public Id)<br />Public ID: a9 f9 de ff 36 22 --&gt; Base64: qfne/zYi<br />AES Key: e1 6e 6e c2 5c 31 46 94 01 9e 44 40 ff c3 43 3b --&gt; Base64: 4W5uwlwxRpQBnkRA/8NDOw==<br />The column &quot;tokenId&quot; represents the Base64 encoded public Id and the secret represents the Base64 encoded AES Key.<br />INSERT INTO yubikeys (client_id, active, tokenId, secret, created, accessed) VALUES ('1', '1', 'qfne/zYi','4W5uwlwxRpQBnkRA/8NDOw==',now(),now());<br /><br />9. TEST YOUR NEW SERVER<br />Launch your favourite browser and go to <!-- 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 --><br />Point to the end of the address field, put your finger on the Yubikey USB token. Now you should see something like this:<br />t=2009-08-27T17:33:57Z0515<br />status=OK<br />h=mtPBJ9BrYCjEqO88a8wfk2IoG1E=<p>Statistics: Posted by <a href="https://forum.yubico.com/memberlist.php?mode=viewprofile&amp;u=825">FloAtFokus</a> — Thu Aug 27, 2009 4:40 pm</p><hr />
]]></content>
</entry>
</feed>