I think this - if it's optional - would normally be easier to deal with than a custom block.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jcnventura’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Active » Needs review
FileSize
4.79 KB

Adding a configurable option to display the login buttons before, after or replacing the core user login form. I've tested this in /user/login and it significantly enhances the usage, bypassing the need for a block. In the case of the 'replace' it even makes it impossible for users to use a password-based login, unless they pass the 'showcore' parameter in the URL.

There's also a couple minor code cleanups in the patch.

sun’s picture

I like this idea. One step closer to a better integration experience! :-)

+++ b/openid_connect.module
+      case 1:
+        // Show the login buttons above the core login form.
...
+      case 2:
+        // Show the login buttons below the core login form.
...
+      case 3:
+        // Only show the OpenID connect buttons.

+++ b/src/Form/SettingsForm.php
+        0 => $this->t('Hidden'),
+        1 => $this->t('Above'),
+        2 => $this->t('Below'),
+        3 => $this->t('Replace'),

Drupal 8 uses named (string) option values instead of magic numbers.

Can you copy the labels into the values (lowercased) and remove the inline comments that will be superfluous afterwards?

sun’s picture

Status: Needs review » Needs work
Mario Steinitz’s picture

Thank you for your suggestion. Using the renderer service to adding the buttons to the login form feels kind of 'hackish' to me.

Please allow some further time to evaluate, whether we have alternatives to rendering the OIDC form within the login form alter hook. E.g. I could imagine to changing the theme wrapper of the login form and providing a custom template that includes the OIDC buttons.

jcnventura’s picture

Status: Needs work » Needs review
FileSize
4.39 KB
3.54 KB

Re-rolled the patch to the latest dev version, and implemented the suggestions by @sun on #2. Also removed some of the extra code standards improvements in the previous patch.

jcnventura’s picture

  • jcnventura authored 436f53c on 8.x-1.x
    Issue #2478487 by jcnventura, sun: Modify the core user login form to...
jcnventura’s picture

Status: Needs review » Fixed

Even if 'hackish' it is better than nothing. And now that the option is there, we can always change the code to implement this in a more elegant way later.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.