1oath_authenticate_usersfile(3) liboath oath_authenticate_usersfile(3)
2
3
4
6 oath_authenticate_usersfile - API function
7
9 #include <oath.h>
10
11 int oath_authenticate_usersfile(const char * usersfile, const char *
12 username, const char * otp, size_t window, const char * passwd, time_t
13 * last_otp);
14
16 const char * usersfile
17 string with user credential filename, in UsersFile format
18
19 const char * username
20 string with name of user
21
22 const char * otp
23 string with one-time password to authenticate
24
25 size_t window
26 how many past/future OTPs to search
27
28 const char * passwd
29 string with password, or NULL to disable password checking
30
31 time_t * last_otp
32 output variable holding last successful authentication
33
35 Authenticate user named username with the one-time password otp and
36 (optional) password passwd. Credentials are read (and updated) from a
37 text file named usersfile.
38
39 Note that for TOTP the usersfile will only record the last OTP and use
40 that to make sure more recent OTPs have not been seen yet when validat‐
41 ing a new OTP. That logics relies on using the same search window for
42 the same user.
43
45 On successful validation, OATH_OK is returned. If the supplied otp is
46 the same as the last successfully authenticated one-time password,
47 OATH_REPLAYED_OTP is returned and the timestamp of the last authentica‐
48 tion is returned in last_otp. If the one-time password is not found in
49 the indicated search window, OATH_INVALID_OTP is returned. Otherwise,
50 an error code is returned.
51
53 Report bugs to <oath-toolkit-help@nongnu.org>. liboath home page:
54 http://www.gnu.org/software/liboath/ General help using GNU software:
55 http://www.gnu.org/gethelp/
56
58 Copyright © 2009-2016 Simon Josefsson.
59 Copying and distribution of this file, with or without modification,
60 are permitted in any medium without royalty provided the copyright
61 notice and this notice are preserved.
62
63
64
65liboath 2.6.2 oath_authenticate_usersfile(3)