diff --git a/config/install/social_auth.settings.yml b/config/install/social_auth.settings.yml
index 9118a21..a4c7c16 100755
--- a/config/install/social_auth.settings.yml
+++ b/config/install/social_auth.settings.yml
@@ -3,3 +3,4 @@ post_login: /user
 redirect_user_form: FALSE
 disable_admin_login: TRUE
 disabled_roles: []
+user_allowed: ['register', 'login']
diff --git a/config/schema/social_auth.schema.yml b/config/schema/social_auth.schema.yml
index e6e14a0..bc6533f 100755
--- a/config/schema/social_auth.schema.yml
+++ b/config/schema/social_auth.schema.yml
@@ -14,6 +14,9 @@ social_auth.settings:
     post_login:
       type: string
       label: 'Drupal path where the user should be redirected after successful login'
+    user_allowed:
+      type: array
+      label: 'What can users do?'
     redirect_user_form:
       type: boolean
       label: 'Redirects to Drupal user form after the user is created if checked'
diff --git a/social_auth.install b/social_auth.install
index 97d2dc5..c131b49 100755
--- a/social_auth.install
+++ b/social_auth.install
@@ -57,3 +57,19 @@ function social_auth_update_8002(&$sandbox) {
   }
   $config->save();
 }
+
+/**
+ * Implements hook_update_N().
+ *
+ * Sets default value for new user_allowed key.
+ *
+ * user_allowed allows site builders to determine if users can only login,
+ * register, or both. This update creates the new user_allowed key with a
+ * default value set to both register and login.
+ */
+function social_auth_update_8003(&$sandbox) {
+  // Sets and saves new user_allowed value.
+  \Drupal::configFactory()->getEditable('social_auth.settings')
+    ->set('user_allowed', ['register', 'login'])
+    ->save();
+}
diff --git a/src/Form/SocialAuthSettingsForm.php b/src/Form/SocialAuthSettingsForm.php
index aee6e27..fbface6 100755
--- a/src/Form/SocialAuthSettingsForm.php
+++ b/src/Form/SocialAuthSettingsForm.php
@@ -92,6 +92,16 @@ class SocialAuthSettingsForm extends ConfigFormBase {
       '#default_value' => $social_auth_config->get('post_login'),
     ];
 
+    $form['social_auth']['user_allowed'] = [
+      '#type' => 'checkboxes',
+      '#title' => $this->t('What can users do?'),
+      '#default_value' => $social_auth_config->get('user_allowed'),
+      '#options' => [
+        'register' => $this->t('Register'),
+        'login' => $this->t('Login'),
+      ],
+    ];
+
     $form['social_auth']['redirect_user_form'] = [
       '#type' => 'checkbox',
       '#title' => $this->t('Redirect new users to Drupal user form'),
@@ -156,6 +166,7 @@ class SocialAuthSettingsForm extends ConfigFormBase {
     $values = $form_state->getValues();
     $this->config('social_auth.settings')
       ->set('post_login', $values['post_login'])
+      ->set('user_allowed', $values['user_allowed'])
       ->set('redirect_user_form', $values['redirect_user_form'])
       ->set('disable_admin_login', $values['disable_admin_login'])
       ->set('disabled_roles', $values['disabled_roles'])
diff --git a/src/SocialAuthUserManager.php b/src/SocialAuthUserManager.php
index e41fd51..f73a3f0 100755
--- a/src/SocialAuthUserManager.php
+++ b/src/SocialAuthUserManager.php
@@ -229,7 +229,6 @@ class SocialAuthUserManager {
       return $this->authenticateNewUser($drupal_user);
     }
 
-    drupal_set_message($this->t('You could not be authenticated, please contact the administrator'), 'error');
     $this->nullifySessionKeys();
     return $this->redirect('user.login');
   }
@@ -250,7 +249,11 @@ class SocialAuthUserManager {
       drupal_set_message($this->t('Authentication for Admin (user 1) is disabled.'), 'error');
       return $this->redirect('user.login');
     }
-
+    // If login is disabled.
+    if ($this->isLoginDisabled()) {
+      drupal_set_message($this->t('Login is disabled for users.'), 'error');
+      return $this->redirect('user.login');
+    }
     // If user can not login because of their role.
     $disabled_role = $this->isUserRoleDisabled($drupal_user);
 
@@ -387,7 +390,7 @@ class SocialAuthUserManager {
             '@social_network_identifier' => $this->pluginId,
             '@provider_user_id ' => $provider_user_id,
           ]);
-
+      drupal_set_message($this->t('You could not be authenticated, please contact the administrator'), 'error');
       return FALSE;
     }
     else {
@@ -431,13 +434,11 @@ class SocialAuthUserManager {
     }
 
     // Check if site configuration allows new users to register.
-    if ($this->registrationBlocked()) {
+    if ($this->isRegistrationDisabled()) {
       $this->loggerFactory
         ->get($this->getPluginId())
-        ->warning('Failed to create user. User registration is disabled in Drupal account settings. Name: @name, email: @email.', ['@name' => $name, '@email' => $email]);
-
+        ->warning('Failed to create user. User registration is disabled. Name: @name, email: @email.', array('@name' => $name, '@email' => $email));
       drupal_set_message($this->t('User registration is disabled, please contact the administrator.'), 'error');
-
       return FALSE;
     }
 
@@ -476,6 +477,7 @@ class SocialAuthUserManager {
         ->error('Could not create new user. Exception: @message', ['@message' => $ex->getMessage()]);
     }
 
+    drupal_set_message($this->t('You could not be authenticated, please contact the administrator'), 'error');
     return FALSE;
   }
 
@@ -520,15 +522,33 @@ class SocialAuthUserManager {
   }
 
   /**
-   * Checks if user registration is blocked in Drupal account settings.
+   * Checks if user login is disabled in Social Auth settings.
+   *
+   * @return bool
+   *   True if login is disabled
+   *   False if login is not disabled
+   */
+  protected function isLoginDisabled() {
+    // Check if Login is disabled in Social Auth Settings.
+    if (!in_array('login', $this->configFactory->get('social_auth.settings')
+      ->get('user_allowed'), TRUE)) {
+      return TRUE;
+    }
+
+    return FALSE;
+  }
+
+  /**
+   * Checks if user registration is disabled.
    *
    * @return bool
-   *   True if registration is blocked
-   *   False if registration is not blocked
+   *   True if registration is disabled
+   *   False if registration is not disabled
    */
-  protected function registrationBlocked() {
-    // Check if Drupal account registration settings is Administrators only.
-    if ($this->configFactory->get('user.settings')->get('register') == 'admin_only') {
+  protected function isRegistrationDisabled() {
+    // Check if Drupal account registration settings is Administrators only
+    // OR if it is disabled in Social Auth Settings.
+    if ($this->configFactory->get('user.settings')->get('register') == 'admin_only' || !in_array('register', $this->configFactory->get('social_auth.settings')->get('user_allowed'), TRUE)) {
       return TRUE;
     }
 
