Core/Auth: Implement time-based token for user login as described in RFC 6238.

New column in account table is a base32 of token key bytes,
coincidentally it is the same format Google's Authenticator Android app uses.
If you want that to work, set system time on server correctly and use ntpd.

Closes #10527

Signed-off-by: Nay <dnpd.dd@gmail.com>
This commit is contained in:
raczman
2013-08-25 14:02:40 +01:00
committed by Nay
parent e96aa444b0
commit ba22baebbd
10 changed files with 160 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ CREATE TABLE `account` (
`sessionkey` varchar(80) NOT NULL DEFAULT '',
`v` varchar(64) NOT NULL DEFAULT '',
`s` varchar(64) NOT NULL DEFAULT '',
`token_key` varchar(100) NOT NULL DEFAULT '',
`email` varchar(254) NOT NULL DEFAULT '',
`joindate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_ip` varchar(15) NOT NULL DEFAULT '127.0.0.1',