Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I think this - if it's optional - would normally be easier to deal with than a custom block.
Comment | File | Size | Author |
---|---|---|---|
#5 | openid_connect-buttons-in-login-form-2478487-5-D8.patch | 3.54 KB | jcnventura |
#5 | interdiff.txt | 4.39 KB | jcnventura |
Comments
Comment #1
jcnventura CreditAttribution: jcnventura commentedAdding 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.
Comment #2
sunI like this idea. One step closer to a better integration experience! :-)
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?
Comment #3
sunComment #4
Mario SteinitzThank 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.
Comment #5
jcnventura CreditAttribution: jcnventura commentedRe-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.
Comment #6
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedComment #8
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedEven 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.