$ curl -X POST https://cloud.logintc.com/api/hardware \
-d '{"type" : "TOTP6", "timeStep" : "60", "serialNumber" : "1000000000001", "seed" : "C5FC43FDD4BC215586A5283AD8296194E034AAE0"}' \
-H 'Authorization: LoginTC key="YOUR_API_KEY"'
{
"id":"d465336ff0ab256c0aa11d0444a49bc840c087f3",
"alias":"HW-d465336f",
"serialNumber":"1000000000001",
"type":"TOTP6",
"timeStep":"60s",
"syncState":"Never Used",
"user":""
}
<?php
// Get the library from github.com/logintc/logintc-php
require_once('logintc-php/LoginTC.php');
// Your API Key from cloud.logintc.com/panel/settings
$api_key = 'YOUR_API_KEY';
$logintc = new LoginTC($api_key);
// Hardware Token details
$alias = "john.doe token";
$serial_number = "1000000000001";
$type = "TOTP6";
$time_step = "60";
$seed = "C5FC43FDD4BC215586A5283AD8296194E034AAE0";
// Helper function to create hardware token
$hardware_token = $logintc->createHardwareToken($alias, $serial_number, $type, $time_step, $seed);
echo $hardware_token->getId();
# Get the library from github.com/logintc/logintc-python
import logintc
# Your API Key from cloud.logintc.com/panel/settings
api_key = 'YOUR_API_KEY'
client = LoginTC(api_key)
# Hardware Token details
alias = 'john.doe token'
serial_number = '1000000000001'
type = 'TOTP6'
time_step = '60'
seed = 'C5FC43FDD4BC215586A5283AD8296194E034AAE0'
# Helper function to create hardware token
hardware_token = client.create_hardware_token(alias, serial_number, type, time_step, seed)
print hardware_token['id']
// Get the library from github.com/logintc/logintc-java
import com.cyphercor.logintc.LoginTC;
import com.cyphercor.logintc.LoginTC.LoginTCException;
import com.cyphercor.logintc.resource.HardwareToken;
public class Example {
// Your API Key from cloud.logintc.com/panel/settings
public static final String API_KEY = "YOUR_API_KEY";
public static void main(String[] args) throws LoginTCException {
LoginTC logintc = new LoginTC(API_KEY);
// Hardware Token details
String alias = "john.doe token";
String serialNumber = "1000000000001";
String type = "TOTP6";
String timeStep = "60";
String seed = "C5FC43FDD4BC215586A5283AD8296194E034AAE0";
// Helper function to create bypass code
HardwareToken hardware_token = logintc.createHardwareToken(alias, serialNumber, type, timeStep, seed);
System.out.println(hardware_token.getId());
}
}