How to get one time login for all the users? I want to send one time login for all the users, So I am using drush uli and getting link like:


  http://html/user/reset/1/1509979615/VBPx_FMfKeJUEt1moVcsSQGUMX_tFUSYEdEfRlmq7eA


So if the user 5 wants to use one time login, this will be used for only the user 1, right? Basically I want to set one time login for all the users. 

How do I pass this URL in Drupal 8?

I just wanna know that how could use this in forgot password mail.
drush

To get one-time login for the specific user, use this syntax:

drush uli &lt;user&gt;


Where &lt;user&gt; is either uid (e.g. 5), user name, or email address for the user.

To get one-time login URL for multiple users or all, you need to run drush in the loop, e.g.

for uid in $(drush sqlq "SELECT uid FROM users"); do drush uli $uid; done


Run drush help uli for help with syntax.

To correct your http://html part, add -l http://example.com parameter, or set your $base_url in your settings file.

Custom code

If you're interested in sending one-time login via e-mail using Drupal, you can use user_pass_reset_url() function in your custom code.


  Generates a unique URL for a user to login and reset their password.


Contrib module

Or use Login one time module (for D8, check this issue).


  Login one time provides the ability to email one-time login links to users.