diff --git a/plugins/DeployAuthenticatorSession.inc b/plugins/DeployAuthenticatorSession.inc
index a122b38..e52f20c 100644
--- a/plugins/DeployAuthenticatorSession.inc
+++ b/plugins/DeployAuthenticatorSession.inc
@@ -68,37 +68,44 @@ class DeployAuthenticatorSession implements DeployAuthenticator {
 
       if ($response_data['session_name'] && $response_data['sessid']) {
         $this->service->config['headers']['Cookie'] = $response_data['session_name'] . "=" . $response_data['sessid'] . ";";
-        // We have to get a CSFR Token from the server and pass along with
+        // We have to get a CSRF Token from the server and pass along with
         // each services call (introduced in Services 7.x-3.4
         // as per SA-CONTRIB-2013-051; https://drupal.org/node/2012982).
-        $user = NULL;
-        $parts = parse_url($this->service->config['url']);
-        $port = '';
+        $token = isset($response_data['token']) ? $response_data['token'] : NULL;
 
-        if (isset($parts['port'])) {
-          $port = ':' . $parts['port'];
-        }
+        // To get the token directly from the login request requires Services
+        // 7.x-3.6 or newer, for older versions we need a separate request.
+        if (!$token) {
+          $user = NULL;
+          $parts = parse_url($this->service->config['url']);
+          $port = '';
 
-        if (isset($parts['user'])) {
-          $user = $parts['user'];
-        }
+          if (isset($parts['port'])) {
+            $port = ':' . $parts['port'];
+          }
 
-        if (isset($parts['pass'])) {
-          $pass = $parts['pass'];
-        }
+          if (isset($parts['user'])) {
+            $user = $parts['user'];
+          }
 
-        $token_url = $parts['scheme'] . '://' . ($user ? $user . ':' . $pass . '@' : '') . $parts['host'] . $port . '/services/session/token';
+          if (isset($parts['pass'])) {
+            $pass = $parts['pass'];
+          }
 
-        $token_response = drupal_http_request($token_url, array('method' => 'GET', 'headers' => $this->service->config['headers']));
-        if (isset($token_response->error) || !in_array($token_response->code, array(200, 304))) {
-          throw new DeployAuthenticationException(t('Authentication error: @code @error', array('@code' => $token_response->code, '@error' => t('Failed to retrieve CSRF token.'))));
-        }
+          $token_url = $parts['scheme'] . '://' . ($user ? $user . ':' . $pass . '@' : '') . $parts['host'] . $port . '/services/session/token';
 
-        if ($this->config['debug']) {
-          watchdog('deploy', 'Session CSRF Token response: @response', array('@response' => print_r($token_response, TRUE)), WATCHDOG_DEBUG);
-        }
+          $token_response = drupal_http_request($token_url, array('method' => 'GET', 'headers' => $this->service->config['headers']));
+          if (isset($token_response->error) || !in_array($token_response->code, array(200, 304))) {
+            throw new DeployAuthenticationException(t('Authentication error: @code @error', array('@code' => $token_response->code, '@error' => t('Failed to retrieve CSRF token.'))));
+          }
+
+          if ($this->config['debug']) {
+            watchdog('deploy', 'Session CSRF Token response: @response', array('@response' => print_r($token_response, TRUE)), WATCHDOG_DEBUG);
+          }
 
-        $this->service->config['headers']['X-CSRF-Token'] = trim($token_response->data);
+          $token = trim($token_response->data);
+        }
+        $this->service->config['headers']['X-CSRF-Token'] = $token;
       }
       else {
         throw new DeployAuthenticationException(t("No session was returned from the authentication request."));
@@ -118,7 +125,7 @@ class DeployAuthenticatorSession implements DeployAuthenticator {
         'method' => 'POST',
         'headers' => array(
           'Cookie' => $response->headers['set-cookie'],
-          'X-CSRF-Token' => trim($token_response->data),
+          'X-CSRF-Token' => $token,
         ),
       );
       $response = drupal_http_request($logout_url, $options);
