Man page - oath_authenticate_usersfile(3)
Packages contains this manual
- oath_bin2hex(3)
- oath_base32_encode(3)
- oath_totp_validate_callback(3)
- oath_strerror_name(3)
- oath_hex2bin(3)
- oath_totp_validate3(3)
- oath_base32_decode(3)
- oath_totp_validate2_callback(3)
- oath_hotp_validate_callback(3)
- oath_totp_validate(3)
- oath_init(3)
- oath_hotp_generate(3)
- oath_authenticate_usersfile(3)
- oath_done(3)
- oath_strerror(3)
- oath_totp_generate2(3)
- oath_totp_validate2(3)
- oath_hotp_validate(3)
- oath_totp_validate4(3)
- oath_totp_generate(3)
- oath_totp_validate3_callback(3)
- oath_check_version(3)
- oath_totp_validate4_callback(3)
apt-get install liboath-dev
Manual
oath_authenticate_usersfile
NAMESYNOPSIS
ARGUMENTS
DESCRIPTION
RETURNS
REPORTING BUGS
COPYRIGHT
NAME
oath_authenticate_usersfile - API function
SYNOPSIS
#include <oath.h>
int oath_authenticate_usersfile(const char * usersfile , const char * username , const char * otp , size_t window , const char * passwd , time_t * last_otp );
ARGUMENTS
const char * usersfile
string with user credential filename, in UsersFile format
const char * username
string with name of user
const char * otp
string with one-time password to authenticate
size_t window
how many past/future OTPs to search
const char * passwd
string with password, or NULL to disable password checking
time_t * last_otp
output variable holding last successful authentication
DESCRIPTION
Authenticate user named username with the one-time password otp and (optional) password passwd . Credentials are read (and updated) from a text file named usersfile .
Note that for TOTP the usersfile will only record the last OTP and use that to make sure more recent OTPs have not been seen yet when validating a new OTP. That logics relies on using the same search window for the same user.
RETURNS
On successful validation, OATH_OK is returned. If the supplied otp is the same as the last successfully authenticated one-time password, OATH_REPLAYED_OTP is returned and the timestamp of the last authentication is returned in last_otp . If the one-time password is not found in the indicated search window, OATH_INVALID_OTP is returned. Otherwise, an error code is returned.
REPORTING BUGS
Report bugs to <oath-toolkit-help@nongnu.org>. liboath home page: https://www.nongnu.org/oath-toolkit/ General help using GNU software: http://www.gnu.org/gethelp/
COPYRIGHT
Copyright ©
2009-2020 Simon Josefsson.
Copying and distribution of this file, with or without
modification, are permitted in any medium without royalty
provided the copyright notice and this notice are
preserved.