← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1703109] Re: Django 1.10.x breaks WEBSSO login form on firefox

 

Reviewed:  https://review.openstack.org/519357
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=63d71468824031ae40bbf34bb379b42a98e2ca94
Submitter: Zuul
Branch:    master

commit 63d71468824031ae40bbf34bb379b42a98e2ca94
Author: Colleen Murphy <colleen@xxxxxxxxxxx>
Date:   Thu Nov 2 18:19:09 2017 +0100

    Don't add required attribute to html form fields
    
    (cherry picked from commit 1fa9ae26cc6006f8ee94fabddb7fea171adee55d
     in django_openstack_auth)
    
    In Django 1.10 a new Form property was introduced, defaulting to True,
    which enabled HTML form validation for fields marked "required" in
    Django. This changed old behavior, which was that required fields were
    only validated server-side. This patch restores old behavior by setting
    use_required_attribute to False for the inherited AuthenticationForm.
    
    This problem arose because when WebSSO is enabled and a
    non-keystone-credentials authentication method is selected from the
    dropdown list, the now-hidden username and password fields are still
    marked "required" and still validated client-side, even though they are
    invisible to the user and cannot be filled in. It would be nice to fix
    the javascript to properly turn the "required" attribute on or off
    depending on what authentication method is selected and whether the
    "required" fields are even visible, but for now this just restores the
    behavior we had before Djanto 1.10.
    
    Change-Id: I3e798a2288d9c33396b40a86b07ea8c163d3b525
    Closes-bug: #1703109


** Changed in: horizon
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1703109

Title:
  Django 1.10.x breaks WEBSSO login form on firefox

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  When using horizon's WebSSO feature and selecting an external IdP for
  the "Authenticate Using" field, clicking the Connect button produces a
  popup box in the upper left corner saying "Please fill out this field"
  instead of forwarding to the keystone IdP. This only happens on
  Firefox (tried with 52.2.0), it works fine in Chrome. The problem goes
  away when Django is downgraded from 1.10.x to 1.9.13. The problem also
  goes away when the "required" attribute of these input fields are
  deleted using the Inspector tool in firefox:

  <input autofocus="autofocus" class="form-control" id="id_username" name="username" required="" type="text">
  <input class="form-control" id="id_password" name="password" required="" type="password">

  Steps to reproduce:

  In local_settings.py, set:

  WEBSSO_ENABLED = True
  WEBSSO_CHOICES = (("mapped", _("Mapped")),)

  Open the dashboard in Firefox and click "Connect".

  Expected result:

  Horizon redirects to /identity/v3/auth/OS-FEDERATION/websso/mapped and
  produces a 401 because keystone isn't set up for federation.

  Actual result:

  Horizon produces a small box in the upper left that says "Please fill
  out this field" with a little arrow that seems like it's intending to
  point to an empty field but is pointing to nothing in particular.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1703109/+subscriptions


References