#353 Use a separate field for OTP in Fedora
Merged 4 months ago by ngompa. Opened 5 months ago by abompard.
abompard/ipsilon otp-field  into  master

@@ -65,6 +65,7 @@ 

      def POST(self, *args, **kwargs):

          username = kwargs.get("login_name")

          password = kwargs.get("login_password")

+         password += kwargs.get("login_otp", "")

          userattrs = None

          authok = False

          errmsg = None

@@ -35,6 +35,7 @@ 

      def POST(self, *args, **kwargs):

          username = kwargs.get("login_name")

          password = kwargs.get("login_password")

+         password += kwargs.get("login_otp", "")

          user = None

          error = None

  

@@ -14,6 +14,7 @@ 

      def POST(self, *args, **kwargs):

          username = kwargs.get("login_name")

          password = kwargs.get("login_password")

+         password += kwargs.get("login_otp", "")

          error = None

  

          if username and password:

@@ -32,6 +32,11 @@ 

        </div>

      </div>

      <div class="form-group">

+       <div class="col-sm-10 col-md-10 col-sm-offset-2 col-md-offset-2">

+         <input type="text" class="form-control" name="login_otp" id="otp" placeholder="One-Time-Password (if you have one)" tabindex="3" />

+       </div>

+     </div>

+     <div class="form-group">

        <div class="col-sm-offset-2 col-md-offset-2 col-xs-12 col-sm-10 col-md-10 submit">

          {% if cancel_url %}

            <a href="{{ cancel_url }}" title="Cancel" class="btn btn-link" tabindex="4">Cancel</a>

@@ -19,8 +19,11 @@ 

                      <div class="form-group">

                          <input class="form-control" id="username" name="login_name" placeholder="Username" autofocus value="{{ username | e }}" />

                      </div>

+                     <div class="form-group">

+                         <input class="form-control" id="password" name="login_password" type="password" placeholder="Password" />

+                     </div>

                      <div class="form-group mb-0">

-                         <input class="form-control" id="password" name="login_password" type="password" placeholder="Password or Password + One-Time-Password" />

+                         <input class="form-control" id="otp" name="login_otp" placeholder="One-Time-Password (if you have one)" />

                      </div>

                  </div>

                  <div class="card-footer d-flex justify-content-between">

@@ -20,8 +20,11 @@ 

                      <div class="form-group">

                          <input class="form-control" id="username" name="login_name" placeholder="Username" autofocus value="{{ username | e }}" />

                      </div>

-                     <div class="form-group mb-0">

+                     <div class="form-group">

                          <input class="form-control" id="password" name="login_password" type="password" placeholder="Password" />

+                     </div>

+                     <div class="form-group mb-0">

+                         <input class="form-control" id="otp" name="login_otp" placeholder="One-Time-Password (if you have one)" />

                          <a target="_blank" href="https://www.microfocus.com/selfreg/jsp/forgotPassword.jsp">Forgot password?</a>

                      </div>

                      </div>

Concatenate the OTP field to the password field if it is in the form post. Don't touch non-Fedora templates.

@abompard Is there a reason you can't adjust the other templates? It seems relatively simple...

Yeah but other instances may not be using OTP tokens. Should I add the field nonetheless?

Yeah, please do so. Even in Fedora, not everyone is using OTPs, so the field has to note that it's optional if you don't have it configured anyway.

rebased onto 14483a1

5 months ago

rebased onto c7f8fc3

4 months ago

rebased onto b68a5e3

4 months ago

Whoops, missed it, sorry. I had to adjust the CSS a bit, which made me realize ipsilon is using Bootstrap 3.x... :older_man:

Yeah, someday we should move to Bootstrap 4...

Pull-Request has been merged by ngompa

4 months ago

It's even 5 these days ;-)