Login with Github, LinkedIn, or Google to post comments

login options

I knew I wanted to allow "social" login on this website as it made me happier that the usernames I might see appearing are more likely to be the people I assume they are β€” they will have some sort of "background check" by virtue of their activity on those other social sites, whatever they were. Well, thanks to drupal/openid_connect, I have successfully implemented login via GitHub, LinkedIn, and Google.

What frustrated me, though, was it is only clear that a reader can actually login and comment easily without the rigmarole of creating an account once that reader actually got to the login form. So, how to change the usual link under every post to make that clear?

Thanks to how Drupal stores strings, mainly so that they can be easily translated, we can add a "string override" to achieve this, just by adding it to settings.php:

// String overrides.
$settings['locale_custom_strings_en'][''] = array(
  '<a href=":login">Log in</a> to post comments' => '<a href=":login">Log in with GitHub, LinkedIn, or Google</a> to post comments',
);

All this does is expand the text a little, making it more obvious that "social login" is possible on this website.

Does it help? Well, I guess you can tell me better than I can tell you...

Tags

Comments7

Thanks for surfacing this! Apart from your own use case, it's a great generic solution to lower participation barriers, you have documented a full-featured implementation, and it avoids the overreaching Facebook and Twitter networks to boot.