From the information provided by you, it seems that there is some problems with tokenid.
Code:
tokenId=<the first 8 chars from the ConvertModhex.java Base64 output>
The tokenid that needs to be inserted in the database is the first 12 modhex characters of the YubiKey OTP converted into Base64 format.
We successfully installed the Java based Yubico OTP validation server in our test environment.
For testing, we reprogrammed one of our YubiKeys using the YubiKey configuration utility available for download at the link given below:
http://www.yubico.com/developers/personalization/We used the following hex encoded parameters for reprogramming the YubiKey:
Code:
tokenId aka YubiKey ID aka Public Identity: 66005af787a3
UserId aka Private Identity: 86137d745f3f
secret aka AES Key aka cryptographic key (shared secret): 75ff8407307fa1884d4cbc1805f9e2e0
After reprogramming the YubiKey, the YubiKey is emitting following OTP:
Code:
hhccglvijilefbbgfcbvnfnreirvgkfgdhngcndiegtb
As we need to insert the tokenId and secret in Base64 format, we converted them to Base64 values using the Modhex Calculator available at the link given below:
http://radius.yubico.com/demo/Modhex_Calculator.php The Base64 converted values are as follows:
Code:
tokenId (first 12 characters of the OTP aka YubiKey ID aka Public Identity i.e hhccglvijile) = "ZgBa94ej" (without quotes)
secret (AES Key i.e 75ff8407307fa1884d4cbc1805f9e2e0) = "df+EBzB/oYhNTLwYBfni4A==" (without quotes)
We inserted these values in the OTP validation server database using the following command (userId is optional):
Code:
mysql> insert into yubikeys (id,client_id,active,created,accessed,tokenId,secret) values (1,1,1,now(),now(),'ZgBa94ej','df+EBzB/oYhNTLwYBfni4A==');
The YubiKey record using the above mentioned insert command looks as follows:
Code:
+----+-----------+--------+---------------------+---------------------+----------+--------+--------------------------+---------+------+------+------------+
| id | client_id | active | created | accessed | tokenId | userId | secret | counter | low | high | sessionUse |
+----+-----------+--------+---------------------+---------------------+----------+--------+--------------------------+---------+------+------+------------+
| 1 | 1 | 1 | 2010-02-24 03:32:10 | 2010-02-24 03:32:10 | ZgBa94ej | | df+EBzB/oYhNTLwYBfni4A== | 0 | 0 | 0 | NULL |
+----+-----------+--------+---------------------+---------------------+----------+--------+--------------------------+---------+------+------+------------+
After that we were able to successfully validate the OTPs.
We would appreciate if you can convert your tokenId and secret parameter to Base64 format, insert the YubiKey record as described above and try again.