SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 23/08/2016, 02:40 PM   #11
JaydenJason
Gangsta
 
JaydenJason's Avatar
 
Join Date: Oct 2014
Location: Netherlands
Posts: 719
Reputation: 51
Default Re: TOTP Plugin

Quote:
Originally Posted by Scranton View Post
You need to be in the same timezone, or at least use the same time in the App and on your server. Also you should check for codes 30 seconds as the time on the device could be slightly out, or in the time taken to input the code it has expired.
There's a 7 hour difference with my server & me....
JaydenJason is offline   Reply With Quote
Old 23/08/2016, 09:18 PM   #12
izeatfishz
Huge Clucker
 
izeatfishz's Avatar
 
Join Date: Jun 2012
Posts: 282
Reputation: 43
Default Re: TOTP Plugin

very nice, was waiting for this in samp
izeatfishz is offline   Reply With Quote
Old 24/08/2016, 08:24 AM   #13
Scranton
Little Clucker
 
Join Date: Aug 2016
Posts: 5
Reputation: 9
Default Re: TOTP Plugin

Quote:
Originally Posted by JaydenJason View Post
There's a 7 hour difference with my server & me....
Then you need to make sure the server and whatever OTP device you're using are using the same time zone. Not sure how ****** Authenticator does it, but I created an app which detects the phones timezone and adjusts it to GMT for the password, as the server was in the UK.
Scranton is offline   Reply With Quote
Old 24/08/2016, 11:17 AM   #14
MerryDeer
Banned
 
Join Date: Jun 2016
Posts: 726
Reputation: 8
Default Re: TOTP Plugin

How to generate right secret keys?
MerryDeer is offline   Reply With Quote
Old 28/08/2016, 04:16 PM   #15
Igorek
Big Clucker
 
Igorek's Avatar
 
Join Date: Oct 2010
Posts: 110
Reputation: 71
Default Re: TOTP Plugin

Quote:
Originally Posted by MerryDeer View Post
How to generate right secret keys?
Secret key generator (base32):

PHP Code:
<?php
//by PHPGangsta

function _getBase32LookupTable()
{
    return array(
        
'A''B''C''D''E''F''G''H'//  7
        
'I''J''K''L''M''N''O''P'// 15
        
'Q''R''S''T''U''V''W''X'// 23
        
'Y''Z''2''3''4''5''6''7'// 31
        
'='  // padding char
    
);
}

function 
createSecret($secretLength 16)
{
    
$validChars _getBase32LookupTable();
    unset(
$validChars[32]);
    
$secret '';
    for (
$i 0$i $secretLength$i++) {
        
$secret .= $validChars[array_rand($validChars)];
    }
    return 
$secret;
}


echo 
createSecret();

?>
Igorek is offline   Reply With Quote
Old 28/08/2016, 04:57 PM   #16
MerryDeer
Banned
 
Join Date: Jun 2016
Posts: 726
Reputation: 8
Default Re: TOTP Plugin

How that look in sa-mp?
MerryDeer is offline   Reply With Quote
Old 30/08/2016, 02:22 PM   #17
JaydenJason
Gangsta
 
JaydenJason's Avatar
 
Join Date: Oct 2014
Location: Netherlands
Posts: 719
Reputation: 51
Default Re: TOTP Plugin

I don't know what I could be doing wrong but timezones are both the same on my phone and on my server, still shows different codes
JaydenJason is offline   Reply With Quote
Old 28/09/2017, 07:21 AM   #18
Igorek
Big Clucker
 
Igorek's Avatar
 
Join Date: Oct 2010
Posts: 110
Reputation: 71
Default Re: TOTP Plugin

Update v.1.0.1
Fix crash strlen(NULL), if you send empty string in function.

Commit:

https://github.com/GamesDV/TOTP/comm...130c0849160199

Download:

https://github.com/GamesDV/TOTP/releases
Igorek is offline   Reply With Quote
Old 28/09/2017, 02:13 PM   #19
Crystallize
High-roller
 
Join Date: Aug 2013
Posts: 1,591
Reputation: 309
Default Re: TOTP Plugin

Quote:
Originally Posted by Igorek View Post
Update v.1.0.1
Fix crash strlen(NULL), if you send empty string in function.

Commit:

https://github.com/GamesDV/TOTP/comm...130c0849160199

Download:

https://github.com/GamesDV/TOTP/releases

Please create a wiki page.
__________________
SAMP BATTLE GROUNDS
87.98.241.207:7780
Crystallize is online now   Reply With Quote
Old 30/11/2017, 01:11 PM   #20
DeepCode
Big Clucker
 
DeepCode's Avatar
 
Join Date: Mar 2014
Location: Russia
Posts: 54
Reputation: 43
Default Re: TOTP Plugin

Quote:
Originally Posted by Igorek View Post
Update v.1.0.1
Fix crash strlen(NULL), if you send empty string in function.

Commit:

https://github.com/GamesDV/TOTP/comm...130c0849160199

Download:

https://github.com/GamesDV/TOTP/releases
it's not working. I got those messages in the console
__________________
privet
DeepCode is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Centos7 - Streamer plugin and crashdetect plugin Su37Erich Server Support 3 12/08/2016 12:18 AM
[MySQL] From StickenKid's plugin to BlueG's plugin jessejanssen Scripting Help 2 15/06/2014 01:20 AM
Very good plugin suggestion (for scripters) and easy to make for the Plugin Developers! Xentiarox Plugin Development 5 29/07/2012 10:48 PM
mysql plugin. loading plugin failed ikkentim Help Archive 2 10/02/2011 02:32 PM


All times are GMT. The time now is 11:48 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.