diff --git a/core/modules/rest/src/Plugin/rest/resource/UserLoginResource.php b/core/modules/rest/src/Plugin/rest/resource/UserLoginResource.php
new file mode 100644
index 0000000..0bfecbc
--- /dev/null
+++ b/core/modules/rest/src/Plugin/rest/resource/UserLoginResource.php
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\rest\Plugin\rest\resource\UserLoginResource.
+ */
+
+namespace Drupal\rest\Plugin\rest\resource;
+
+use Drupal\rest\ResourceResponse;
+use Drupal\rest\Plugin\ResourceBase;
+use Drupal\user\Entity\User;
+
+/**
+ * Represents user login as resource.
+ *
+ * @RestResource(
+ *   id = "user_login",
+ *   label = @Translation("User Login")
+ * )
+ */
+class UserLoginResource extends ResourceBase {
+
+  /**
+   * Responds to the user login POST requests and log in a user.
+   *
+   * @param array $credentials
+   *   The username and pass.
+   *
+   * @return \Drupal\rest\ResourceResponse
+   *   The HTTP response object.
+   */
+  public function post(array $credentials = array()) {
+    // Verify that the credentials are populated.
+    if (!empty($credentials)) {
+      // Verify that the username is filled.
+      if (!array_key_exists('name', $credentials)) {
+        return new ResourceResponse('Missing username.', 400, array());
+      }
+      // Verify that the username is filled.
+      if (!array_key_exists('pass', $credentials)) {
+        return new ResourceResponse('Missing pass.', 400, array());
+      }
+      // Log in the user.
+      if ($uid = \Drupal::service('user.auth')->authenticate($credentials['name'], $credentials['pass'])) {
+        $user = User::load($uid);
+        user_login_finalize($user);
+        return new ResourceResponse('You are logged in as ' . $credentials['name'], 200, array());
+      }
+        return new ResourceResponse('Sorry, unrecognized username or password.', 400, array());
+    }
+    return new ResourceResponse('Missing name and pass.', 400, array());
+  }
+
+}
\ No newline at end of file
