@@ -117,6 +117,46 @@ diagram.
117117 authentication mechanism. This will be explained separately for each
118118 mechanism.
119119
120+ krb5_child
121+ **********
122+ ``krb5_child `` is the helper binary in charge of Kerberos authentication. It
123+ follows the general model of separating the authencation in two steps:
124+ ``preauthentication `` and ``authentication ``. The first part opens a connection
125+ to the KDC to receive the Kerberos pre-authentication methods available for the
126+ given user. ``krb5_child `` behaves differently depending if there are
127+ pre-authentication methods which have to keep the state. Currently this would
128+ be EIdP and passkey. If such a method is found it is immediately selected by
129+ ``krb5_child ``, which keeps running and hence keeps the state while the
130+ information is displayed to the user and they follow the necessary steps for
131+ authentication. At this point is when the status changes to ``authentication ``
132+ and the still running ``krb5_child `` proceeds with the authentication itself.
133+
134+ If there are no ``stateful `` authentication methods found (password, 2-factor
135+ authentication, Smartcard/pkinit) a list of available methods are returned by
136+ ``krb5_child `` at the end of ``preauthentication `` and ``krb5_child `` exits.
137+ The PAM responder selects an authentication method based on some heuristics,
138+ e.g. if pkinit is available and a Smartcard is present pkinit is selected. Now
139+ the suitable prompt is displayed to the user and after they entered the
140+ required credentials the backend starts a new ``krb5_child `` for
141+ ``authentication ``. After the KDC has returned the available Kerberos
142+ pre-authentication method ``krb5_child `` uses the pre-authentication methods
143+ matching the given credentials to finish the authentication.
144+
145+ This was a valid solution when SSSD was the one deciding which authentication
146+ method to use during the process. This is no longer the case, since with this
147+ new proposal it is the user who decides the mechanism to be used, so the
148+ current ``krb5_child `` design must be extended.
149+
150+ During the ``preauthentication `` phase, ``krb5_child `` opens a connection to
151+ the KDC to receive the Kerberos pre-authentication methods available for the
152+ given user and all necessary information (e.g. login URLs, codes, prompts).
153+ At this point ``krb5_child `` is kept alive for all methods as it must wait for
154+ the user response. The information is displayed to the user and once they enter
155+ the credentials, pam_sss switches to the ``authentication `` phase and PAM
156+ responder serializes the credentials in the ``sss_auth_token `` structure.
157+ The still running ``krb5_child `` gets the authentication type and the
158+ credentials, and proceeds with the authentication itself.
159+
120160.. _data :
121161
122162Data
0 commit comments