View operations
'Generate unique access link' bulk actions
'Block login form' user field

This project is not covered by Drupal’s security advisory policy.

This Drupal module allows you to lock the login form per role or individual user to force the use of a single sign-on link. It also allows you to generate unique login links for users. These links can be used to log into the site without needing a username and password.

Why this module?

There are cases in which certain users, especially those with higher permissions, do not use the username and password for login at all. Sometimes, in extreme cases, the user's password is not even known.

In these cases where a drush uli is used directly to access the site, it is safer to remove the possibility of login with username and password.

The case that seems to me more clear is the one of the users with administrator role. That should be the minimum essential and used only when necessary.

Post-Installation

The module is ready to use when the installation is finished. But several things can be configured:

  • Configure for which user roles the login form is locked in the module configuration form (/admin/config/development/user_one_time_login).
  • Go to the edit form of specific users you want to block and check the checkbox "Block login form".

Additional Requirements

Views Bulk Operations (VBO) is used to create one time links for several users at the same time.

You have to edit "People" view (/admin/structure/views/view/user_admin_people) to replace the default field "Bulk update" by the field "Views bulk operations".

Make sure you add in the options of the new field the "Selected actions" that you need. The action "Generate unique access link" is now available in the "People" view bulk operations.

Module settings

The configuration of the module is available at the path /admin/config/development/user_one_time_login

Here you can select the user roles of your Drupal site that will have the login form blocked.

Similar projects

There is a similar module called One Time Login Link Admin that also allows you to create password reset links from the administration interface.

User One Time Login differs from this one in the possibility of blocking the user login form by user role or to a specific user.

Project information

Releases