I would like to prevent my users to login except for those who login through my REST Service.
Is that possible?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityIt sounds like the login_disable module will do exactly what you need.
Prevent users from logging in to your Drupal site unless they know the secret key to add to the end of the login form page. ( default: http://example.com/?q=user/login&admin )
If your site has clean urls enabled you may use http://example.com/user/login?admin instead.
That way you can set a secret key so only users who know that key are able to log in using the login form.
Another possible solution would be to disable the login form completely, like this:
function MY_MODULE_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'user_login') {
$form['#access'] = FALSE;
}
}