xref: /freebsd/crypto/krb5/doc/html/_sources/admin/otp.rst.txt (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert.. _otp_preauth:
2*7f2fe78bSCy Schubert
3*7f2fe78bSCy SchubertOTP Preauthentication
4*7f2fe78bSCy Schubert=====================
5*7f2fe78bSCy Schubert
6*7f2fe78bSCy SchubertOTP is a preauthentication mechanism for Kerberos 5 which uses One
7*7f2fe78bSCy SchubertTime Passwords (OTP) to authenticate the client to the KDC.  The OTP
8*7f2fe78bSCy Schubertis passed to the KDC over an encrypted FAST channel in clear-text.
9*7f2fe78bSCy SchubertThe KDC uses the password along with per-user configuration to proxy
10*7f2fe78bSCy Schubertthe request to a third-party RADIUS system.  This enables
11*7f2fe78bSCy Schubertout-of-the-box compatibility with a large number of already widely
12*7f2fe78bSCy Schubertdeployed proprietary systems.
13*7f2fe78bSCy Schubert
14*7f2fe78bSCy SchubertAdditionally, our implementation of the OTP system allows for the
15*7f2fe78bSCy Schubertpassing of RADIUS requests over a UNIX domain stream socket.  This
16*7f2fe78bSCy Schubertpermits the use of a local companion daemon which can handle the
17*7f2fe78bSCy Schubertdetails of authentication.
18*7f2fe78bSCy Schubert
19*7f2fe78bSCy Schubert
20*7f2fe78bSCy SchubertDefining token types
21*7f2fe78bSCy Schubert--------------------
22*7f2fe78bSCy Schubert
23*7f2fe78bSCy SchubertToken types are defined in either :ref:`krb5.conf(5)` or
24*7f2fe78bSCy Schubert:ref:`kdc.conf(5)` according to the following format::
25*7f2fe78bSCy Schubert
26*7f2fe78bSCy Schubert    [otp]
27*7f2fe78bSCy Schubert        <name> = {
28*7f2fe78bSCy Schubert            server = <host:port or filename> (default: see below)
29*7f2fe78bSCy Schubert            secret = <filename>
30*7f2fe78bSCy Schubert            timeout = <integer> (default: 5 [seconds])
31*7f2fe78bSCy Schubert            retries = <integer> (default: 3)
32*7f2fe78bSCy Schubert            strip_realm = <boolean> (default: true)
33*7f2fe78bSCy Schubert            indicator = <string> (default: none)
34*7f2fe78bSCy Schubert        }
35*7f2fe78bSCy Schubert
36*7f2fe78bSCy SchubertIf the server field begins with '/', it will be interpreted as a UNIX
37*7f2fe78bSCy Schubertsocket.  Otherwise, it is assumed to be in the format host:port.  When
38*7f2fe78bSCy Schuberta UNIX domain socket is specified, the secret field is optional and an
39*7f2fe78bSCy Schubertempty secret is used by default.  If the server field is not
40*7f2fe78bSCy Schubertspecified, it defaults to |kdcrundir|\ ``/<name>.socket``.
41*7f2fe78bSCy Schubert
42*7f2fe78bSCy SchubertWhen forwarding the request over RADIUS, by default the principal is
43*7f2fe78bSCy Schubertused in the User-Name attribute of the RADIUS packet.  The strip_realm
44*7f2fe78bSCy Schubertparameter controls whether the principal is forwarded with or without
45*7f2fe78bSCy Schubertthe realm portion.
46*7f2fe78bSCy Schubert
47*7f2fe78bSCy SchubertIf an indicator field is present, tickets issued using this token type
48*7f2fe78bSCy Schubertwill be annotated with the specified authentication indicator (see
49*7f2fe78bSCy Schubert:ref:`auth_indicator`).  This key may be specified multiple times to
50*7f2fe78bSCy Schubertadd multiple indicators.
51*7f2fe78bSCy Schubert
52*7f2fe78bSCy Schubert
53*7f2fe78bSCy SchubertThe default token type
54*7f2fe78bSCy Schubert----------------------
55*7f2fe78bSCy Schubert
56*7f2fe78bSCy SchubertA default token type is used internally when no token type is specified for a
57*7f2fe78bSCy Schubertgiven user.  It is defined as follows::
58*7f2fe78bSCy Schubert
59*7f2fe78bSCy Schubert    [otp]
60*7f2fe78bSCy Schubert        DEFAULT = {
61*7f2fe78bSCy Schubert            strip_realm = false
62*7f2fe78bSCy Schubert        }
63*7f2fe78bSCy Schubert
64*7f2fe78bSCy SchubertThe administrator may override the internal ``DEFAULT`` token type
65*7f2fe78bSCy Schubertsimply by defining a configuration with the same name.
66*7f2fe78bSCy Schubert
67*7f2fe78bSCy Schubert
68*7f2fe78bSCy SchubertToken instance configuration
69*7f2fe78bSCy Schubert----------------------------
70*7f2fe78bSCy Schubert
71*7f2fe78bSCy SchubertTo enable OTP for a client principal, the administrator must define
72*7f2fe78bSCy Schubertthe **otp** string attribute for that principal.  (See
73*7f2fe78bSCy Schubert:ref:`set_string`.)  The **otp** user string is a JSON string of the
74*7f2fe78bSCy Schubertformat:
75*7f2fe78bSCy Schubert
76*7f2fe78bSCy Schubert.. code-block:: xml
77*7f2fe78bSCy Schubert
78*7f2fe78bSCy Schubert    [{
79*7f2fe78bSCy Schubert        "type": <string>,
80*7f2fe78bSCy Schubert        "username": <string>,
81*7f2fe78bSCy Schubert        "indicators": [<string>, ...]
82*7f2fe78bSCy Schubert     }, ...]
83*7f2fe78bSCy Schubert
84*7f2fe78bSCy SchubertThis is an array of token objects.  Both fields of token objects are
85*7f2fe78bSCy Schubertoptional.  The **type** field names the token type of this token; if
86*7f2fe78bSCy Schubertnot specified, it defaults to ``DEFAULT``.  The **username** field
87*7f2fe78bSCy Schubertspecifies the value to be sent in the User-Name RADIUS attribute.  If
88*7f2fe78bSCy Schubertnot specified, the principal name is sent, with or without realm as
89*7f2fe78bSCy Schubertdefined in the token type.  The **indicators** field specifies a list
90*7f2fe78bSCy Schubertof authentication indicators to annotate tickets with, overriding any
91*7f2fe78bSCy Schubertindicators specified in the token type.
92*7f2fe78bSCy Schubert
93*7f2fe78bSCy SchubertFor ease of configuration, an empty array (``[]``) is treated as
94*7f2fe78bSCy Schubertequivalent to one DEFAULT token (``[{}]``).
95*7f2fe78bSCy Schubert
96*7f2fe78bSCy Schubert
97*7f2fe78bSCy SchubertOther considerations
98*7f2fe78bSCy Schubert--------------------
99*7f2fe78bSCy Schubert
100*7f2fe78bSCy Schubert#. FAST is required for OTP to work.
101