Binom Documentation

Go to navigation

Two-factor authentication

You can set up two-factor authentication to log in to Binom, which allows logging in via a unique one-time password.

Setup


To begin, install the Google Authenticator app on your mobile device (iOS/Android).

Go to Settings > 2FA.

Open Google Authenticator and scan your QR code or enter secret key. Then enter a 6-digit app code to the Enter Code field and click Validate.  

Kepp in mind that if you lose access to your device with installed Google Authenticator, you will not be able to log in to Binon. So make sure to save your QR code or secret key to restore access on a new device.

Deactivation


To deactivate two-factor authentication, go to Settings > 2FA and click Turn off.

If there are several users added to the tracker, administrators can turn off 2FA for them.

API compatibility


If you set up 2FA, you must add the code= parameter to each query to use API. Parameter value is generated via the following function:

                
                  <?php
echo get2FACode('YOURSECRETKEY');
function get2FACode($a){
$c=array_flip(array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','2','3','4','5','6','7','='));
$b=str_split($a);
$d='';
for($i=0;$i<count($b);$i=$i+8){
$x='';
for($j=0;$j<8;++$j){ $x.=str_pad(base_convert(@$c[@$b[$i+$j]],10,2),5,'0',STR_PAD_LEFT); }
$e=str_split($x,8);
for($z=0;$z<count($e);++$z){ $d.=(($y=chr(base_convert($e[$z],2,10)))||ord($y)==48)?$y:''; }
}
$f=hash_hmac('SHA1',(chr(0).chr(0).chr(0).chr(0).pack('N*',floor(time()/30))),$d,true);
$g=unpack('N',substr($f,ord(substr($f,-1)) & 0x0F,4));
return str_pad(($g[1] & 0x7FFFFFFF)%pow(10,6),6,'0',STR_PAD_LEFT);
}
?>

Instead of YOURSECRETKEY specify secret key from the 2FA tab.