Posted by scor on March 31, 2009 at 7:48pm
Is there a way to restrict user registration to openID only. I was not able to find such a module, though I looked at a few openID related modules. Optionally it could also require openID to log in such as the LDAP module does already (and disable the regular login mechanism except for uid 1).

Comments
Possible...
I created this method, but it's hacky and bypasses security.
How to:
I have this live on http://in-universe.fanon.clubpenguinwiki.info.
Patch:
--- openid.module.old 2010-11-30 09:16:37.000000000 -0800
+++ openid.module 2011-02-18 20:21:00.000000000 -0800
@@ -609,7 +609,7 @@
drupal_set_message(t('You must validate your email address for this account before logging in via OpenID.'));
}
}
- elseif (variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)) {
+ else {
// Register new user.
// Save response for use in openid_form_user_register_form_alter().
@@ -621,6 +621,9 @@
if (!empty($form_state['user'])) {
module_invoke_all('openid_response', $response, $form_state['user']);
+ $newaccount = user_external_load($identity);
+ user_save($newaccount, array('status' => 1));
+ drupal_set_message(t("Your account has been created, and is now active. Please disregard the message above, you can login instantly."));
drupal_goto();
}
@@ -645,9 +648,6 @@
unset($_GET['destination']);
drupal_goto('user/register', array('query' => $destination));
}
- else {
- drupal_set_message(t('Only site administrators can create new user accounts.'), 'error');
- }
drupal_goto();
}
Update: Updated with a friendly message.