<div dir="ltr">I&#39;d say option 1 then. Folks can customize the login screen if they want something else.</div><div class="gmail_extra"><br><div class="gmail_quote">On 15 August 2016 at 15:35, Bruno Oliveira <span dir="ltr">&lt;<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2016-08-15, Stian Thorgersen wrote:<br>
&gt; I&#39;ve always hated having password+otp in a single field when login to<br>
&gt; internal SSO. We can do it that way for the FreeIPA integration, but the<br>
&gt; users wouldn&#39;t know what to do if a realm allows both regular KC users and<br>
&gt; users from as FreeIPA instance. Nor does it work well for installations<br>
&gt; where otp is not mandatory.<br>
<br>
</span>There are some alternatives for it:<br>
<br>
1. Document and leave it as is for the SSSD federation provider. People<br>
coming from FreeIPA world are familiar with this.<br>
<br>
2. Add a label inside the password field like FreeIPA console does[1]<br>
for usability purposes. From my understanding, it would require<br>
extending UsernamePassword form and provide a new login interface.<br>
<br>
3. Provide new OTP screen for SSSD provider with a single field, &quot;OTP&quot;<br>
and QRCode info omitted. Because, all the steps to configure two-factor<br>
happen on the FreeIPA side.<br>
<br>
My suggestion is to stick with 1 for now and iterate over it for improvements.<br>
<br>
<br>
[1] - <a href="http://imgur.com/eyk5Ewx" rel="noreferrer" target="_blank">http://imgur.com/eyk5Ewx</a><br>
<div><div class="h5"><br>
&gt;<br>
&gt; On 25 July 2016 at 23:33, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hi Bill,<br>
&gt; &gt;<br>
&gt; &gt; After giving these ideas a try, I started to think about the FreeIPA<br>
&gt; &gt; flow and how 2FA validation works. If we provide for the first factor<br>
&gt; &gt; username + password or username + (password and OTP - in the same field),<br>
&gt; &gt; credentials will be validated anyways. I was misguided by the second prompt<br>
&gt; &gt; from sudo, thinking that second factor was mandatory (sorry about that).<br>
&gt; &gt;<br>
&gt; &gt; The same happens for the FreeIPA web interface, we just provide username +<br>
&gt; &gt; password and OTP (if it was configured).<br>
&gt; &gt;<br>
&gt; &gt; That said, I believe we don&#39;t have to add any extra code, aside of what<br>
&gt; &gt; we already have for the SSSD Federation provider. I&#39;ve already<br>
&gt; &gt; tested it with and without OTP. The only downside of this approach is<br>
&gt; &gt; the fact that we&#39;re not going to have an OTP screen and it has to be<br>
&gt; &gt; documented in some place.<br>
&gt; &gt;<br>
&gt; &gt; Does anyone have objections about leaving the flow as is?<br>
&gt; &gt;<br>
&gt; &gt; On 2016-07-20, Bill Burke wrote:<br>
&gt; &gt; &gt; Just create a different form and new Authenticator.  I don&#39;t think we<br>
&gt; &gt; want<br>
&gt; &gt; &gt; all this logic with Freemarker, do we?  The UI is decoupled from<br>
&gt; &gt; credential<br>
&gt; &gt; &gt; validation on purpose so that you can move things around, i.e. a Username<br>
&gt; &gt; &gt; screen, then the next screen is password/OTP input.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Another thing you could do is collect credentials and store them in the<br>
&gt; &gt; &gt; ClientSessionModel, then once you&#39;ve collected the credentials, validate<br>
&gt; &gt; &gt; them all in one go.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On 7/20/16 10:06 AM, Bruno Oliveira wrote:<br>
&gt; &gt; &gt; &gt; On 2016-07-19, Stian Thorgersen wrote:<br>
&gt; &gt; &gt; &gt; &gt; Adding Bill..<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; It would probably still be better to use user federation for<br>
&gt; &gt; verifying<br>
&gt; &gt; &gt; &gt; &gt; credentials, but we would need some logic on how to determine what<br>
&gt; &gt; &gt; &gt; &gt; mechanism to use for primary authentication and secondary<br>
&gt; &gt; authentication.<br>
&gt; &gt; &gt; &gt; &gt; Bill was talking about adding some conditional flows to the<br>
&gt; &gt; authentication<br>
&gt; &gt; &gt; &gt; &gt; maybe that&#39;s what we need.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; For now I&#39;d focus on OTP though and then move on to smartcard<br>
&gt; &gt; afterwards.<br>
&gt; &gt; &gt; &gt; I can give it a try and workaround, but I&#39;m not sure if worth the<br>
&gt; &gt; &gt; &gt; effort, assuming that later will be necessary to revisit.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; If we hardcode/workaround it on Keycloak, user&#39;s coming from FreeIPA<br>
&gt; &gt; &gt; &gt; may have their login denied. Even if we ignore smartcards for now. Why?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Depending on the auth types SSSD will show different login prompts. For<br>
&gt; &gt; &gt; &gt; example:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; * Password<br>
&gt; &gt; &gt; &gt;    Login prompt - $ Password:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; * OTP<br>
&gt; &gt; &gt; &gt;    Login prompt -&gt; $ First factor:<br>
&gt; &gt; &gt; &gt;                    $ Second factor:<br>
&gt; &gt; &gt; &gt;    Note: Please notice that they are not validated separately<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; * Password + OTP -&gt; $ First factor or password:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; That&#39;s the reason why I would like to make the our login screen<br>
&gt; &gt; &gt; &gt; dynamic.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; On 19 July 2016 at 11:00, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; The problem here is the fact that not necessarily the<br>
&gt; &gt; &gt; &gt; &gt; &gt; first factor will be a pasword or the second factor an OTP. It<br>
&gt; &gt; &gt; &gt; &gt; &gt; could be a smartcard for example. That&#39;s why I think is a better<br>
&gt; &gt; idea to<br>
&gt; &gt; &gt; &gt; &gt; &gt; make it dynamic, because we don&#39;t have control over it to tell<br>
&gt; &gt; &gt; &gt; &gt; &gt; if the second factor will be a smartcard or an OTP for example.<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; Does it make sense?<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; On 2016-07-19, Stian Thorgersen wrote:<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Looks like it&#39;s better to keep as is and have user federation<br>
&gt; &gt; provider<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; validate otp credentials as well. The current OTP authenticator<br>
&gt; &gt; delegates<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; to user federation provider, so you&#39;d end up with a separate OTP<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; authenticator to do it with PAM.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; On 19 July 2016 at 00:48, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Good morning,<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Today to authentication against PAM with just simple<br>
&gt; &gt; username/password<br>
&gt; &gt; &gt; &gt; &gt; &gt; I<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; implemented UserFederationProvider and added the proper PAM<br>
&gt; &gt; login to<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; validCredentials[1]. This covers the most basic scenario.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Now I would like to cover a more complex scenario like OTP and<br>
&gt; &gt; change<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; the flow a little bit like this:<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 1. User providers her username<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 2. The next screen asks to provide how many factor our user<br>
&gt; &gt; has(For<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; example: OTP, password). We just don&#39;t know, PAM will tell<br>
&gt; &gt; what&#39;s next.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 3. We authenticate against it<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; To see in practice against FreeIPA server, I just recorded it<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; for a practical example[2].<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; What would be the best approach to implement this flow? I was<br>
&gt; &gt; &gt; &gt; &gt; &gt; considering<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; to<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; move my authentication logic out of SSSD federation provider<br>
&gt; &gt; and<br>
&gt; &gt; &gt; &gt; &gt; &gt; create a<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; PAM<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; authenticator.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Does it make sense?<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; [1] -<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; <a href="http://www.keycloak.org/docs/javadocs/org/keycloak/models/" rel="noreferrer" target="_blank">http://www.keycloak.org/docs/<wbr>javadocs/org/keycloak/models/</a><br>
&gt; &gt; UserFederationProvider.html#<wbr>validCredentials-org.keycloak.<br>
&gt; &gt; models.RealmModel-org.<wbr>keycloak.models.<wbr>UserCredentialModel-<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; [2] - <a href="https://asciinema.org/a/atwnfbu0kqfasjl65weyoiz7a" rel="noreferrer" target="_blank">https://asciinema.org/a/<wbr>atwnfbu0kqfasjl65weyoiz7a</a><br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; --<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; abstractj<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; PGP: 0x84DC9914<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; ______________________________<wbr>_________________<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; keycloak-dev mailing list<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/keycloak-dev</a><br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; --<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; abstractj<br>
&gt; &gt; &gt; &gt; &gt; &gt; PGP: 0x84DC9914<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; --<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; abstractj<br>
&gt; &gt; &gt; &gt; PGP: 0x84DC9914<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt;<br>
&gt; &gt; abstractj<br>
&gt; &gt; PGP: 0x84DC9914<br>
&gt; &gt;<br>
<br>
</div></div>--<br>
<br>
abstractj<br>
PGP: 0x84DC9914<br>
</blockquote></div><br></div>