oath_authenticate_usersfile(3)
π oath_authenticate_usersfile(3) β liboath edition π
π NAME π
oath_authenticate_usersfile β API function, bestie. Thatβs the whole name vibe. β¨
β¨ SYNOPSIS β¨
okay so hereβs the exact signature, no cap:
#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β a string with the user credential filename, in UsersFile format. Think: where the receipts live. π§Ύconst char * usernameβ a string with the name of the user. Main character identified. πconst char * otpβ a string with the one-time password to authenticate. The little secret code era. π₯size_t windowβ how many past/future OTPs to search. Yes, itβs giving βlook around the timeline.β β³const char * passwdβ a string with the password, orNULLto disable password checking. Choose your fighter. πtime_t * last_otpβ output variable holding last successful authentication. The receipt of the last successful slay. π«Ά
πΈ 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. π
TOTP bestie note: 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 logic relies on using the same search window for the same user. π
π₯ RETURNS π₯
On successful validation, OATH_OK is returned. Slay. β
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. Replay detected, bestie. π¨
If the one-time password is not found in the indicated search window, OATH_INVALID_OTP is returned. Not in this timeline. π
Otherwise, an error code is returned. Mystery little gremlin error energy. π
π REPORTING BUGS π
Report bugs to <oath-toolkit-help@nongnu.org>. liboath home page: https://oath-toolkit.codeberg.page/ General help using GNU software: http://www.gnu.org/gethelp/ π«Ά
π COPYRIGHT π
Copyright Β© 2009-2026 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. π
β signed off from liboath 2.6.15, with Β© 2009-2026 energy Β· bye bestie, go authenticate responsibly π π«Ά
π¦ where this page comes from
- arch rolling: oath-toolkit 2.6.15-1 Β· GPL-3.0-or-later
- nixpkgs unstable: oath-toolkit 2.6.15
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms