User login using a token or ID (no password) How I am able to create a form/link to let assigned/special users to log-in to the system without entering their username and password?

I want them to be able to use a link/token to login to system instead.

This is mainly for development purpose and I am aware of the security risks on the live website

Thank you in advanced
If security's not a concern (and make sure it really isn't!) then you might as well do it the simplest way possible.

This would involve a small custom module that provides a path to log in users by their ID.

function MYMODULE_menu() {
  $items['insecure-login/%MYMODULE_insecure_login'] = array(
    'title' =&gt; 'Insecure login',
    'access callback' =&gt; TRUE, // Might as well be, no point in authenticating
    'page callback' =&gt; 'MYMODULE_insecure_login',
    'page arguments' =&gt; array(1)
  );

  return $items;
}

function MYMODULE_insecure_login_load($uid) {
  // Don't let user 1 login with this method
  if ($uid == 1) {
    return FALSE;
  }

  // Just return the user ID
  return $uid;
}


function MYMODULE_insecure_login($uid) {
  if ($account = user_load($uid)) {
    global $user;
    $user-&gt;uid = $uid;
    $user-&gt;name = $account-&gt;name;
    $user-&gt;timezone = $account-&gt;timezone;
    user_login_finalize();
    drupal_goto('user');
  }
}


Users will be able to login by visiting http://example.com/insecure-login/USER_ID

I've tested this and it worked, but it felt very wrong. The above code is just a proof of concept if you like, I can't really recommend that you use it.

Please, please double check your thinking before using any method like this; you're obviously aware of the security implications but I can't sign off this post in good conscience without encouraging you to think about it a little more ;)