Debian Codegraph @

contrib/slapd-modules/passwd/totp/slapo-totp.5

raw
1 .TH PW-TOTP 5 "2015/7/2" "PW-TOTP"
2 .\" Copyright 2015-2024 The OpenLDAP Foundation.
3 .\" Portions Copyright 2015 by Howard Chu, Symas Corp. All rights reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
5 .SH NAME
6 pw-totp \- TOTP Password handling module
7 .SH SYNOPSIS
8 .B moduleload
9 .I pw-totp.la
10 .SH DESCRIPTION
11 The
12 .B pw-totp
13 module allows time-based one-time password, AKA "authenticator-style",
14 authentication to be added to applications that use LDAP for
15 authentication. In most cases no changes to the applications are needed to switch
16 to this type of authentication.
17
18 With this module, the password needed for a user to authenticate is calculated
19 based on the current time and a key that is stored in the user's LDAP entry. Since
20 the password is based on the time, it changes periodically. Once used, it cannot be
21 used again so keyloggers and shoulder-surfers are thwarted. A mobile
22 phone application, such as the Google Authenticator (a 'prover'), can be used
23 to calculate the user's current password, which is expressed as a six-digit
24 number.
25 Alternatively, the value can be calculated by some other application with access
26 to the user's key and delivered to the user through SMS or some other channel.
27 When prompted to authenticate, the user merely enters the six-digit code provided by
28 the prover.
29
30 Additionally, the overlay can also authenticate TOTP passwords
31 combined with a static password. To do this, utilize one of the
32 {TOTP1ANDPW}, {TOTP256ANDPW}, or {TOTP512ANDPW} password schemes
33 and append the static password scheme value to the end of the
34 userPassword attribute, separated by a pipe (|) character.
35
36 This implementation complies with
37 .B RFC 6238 TOTP Time-based One Time Passwords
38 and includes support for the SHA-1, SHA-256, and SHA-512 HMAC
39 algorithms.
40
41 The HMAC key used in the TOTP computation is stored in the userPassword attribute
42 of the user's LDAP entry and the LDAP Password Modify Extended Operation is used to
43 set and change the value. The
44 value should correspond to that used by the the prover (authenticator).
45
46 .SH CONFIGURATION
47 Once the module is loaded with the moduleload command from the synopsis,
48 the {TOTP1}, {TOTP256}, {TOTP512}
49 {TOTP1ANDPW}, {TOTP256ANDPW}, and {TOTP512ANDPW}
50 password schemes will be recognized.
51
52 On the databases where your users reside you must configure the
53 totp overlay:
54
55 .nf
56 database mdb
57 \...
58 overlay totp
59 \...
60 .fi
61
62 You can tell OpenLDAP to use one of these new schemes when processing LDAP
63 Password Modify Extended Operations, thanks to the password-hash option in
64 slapd.conf. For example:
65
66 .nf
67 password-hash {TOTP256}
68 .fi
69
70 .SH NOTES
71 This module includes functionality implemented by the slapo-lastbind overlay
72 and cannot coexist with it in the same database. Also note
73 that since the time that the last bind occurred
74 is needed to properly implement TOTP, provisions need to be made to propagate
75 the authTimestamp attribute to other servers that are providing authentication
76 services.
77
78 The hash functions for the {TOTP1ANDPW}, {TOTP256ANDPW}, and {TOTP512ANDPW}
79 schemes expect the secret to be entered in the form:
80 <OTP seed><DELIM><static password>, where DELIM is currently defined
81 as the pipe character (|).
82
83 .SH BUGS
84 The time step is hard-coded to thirty seconds. This should be OK for many use cases,
85 but it would be nice if the value
86 could be changed with a configuration keyword or in an attribute value.
87 However, after one successful initial authentication (to verify
88 the clocks on the server and the user's prover are in sync) the TOTP
89 value of the previous time window may also be used to successfully
90 authenticate, provided no successful bind has been performed already
91 in the current or previous time window. This eliminates false
92 negatives caused by user or network delays
93 entering or transmitting the TOTP value.
94
95 The authenticator code that is generated is hard-coded to a length of six digits.
96 While in most cases
97 this is probably better than the alternative length of four digits, there may be
98 cases where a four-digit value is preferred.
99
100 In cases where password-hash lists multiple mechanisms, the TOTP key will also
101 be changed at the same time. This is likely to be undesirable behavior.
102
103 .SH "SEE ALSO"
104 .BR slapd.conf (5) ldappasswd (1)
105 .SH ACKNOWLEDGEMENT
106 This work was developed by Howard Chu of Symas Corporation for inclusion in
107 OpenLDAP Software.
108
109 Password + TOTP support added by Greg Veldman on behalf of SCinet.