diff --git a/wsclient.module b/wsclient.module
index fa6bee3..677996e 100644
--- a/wsclient.module
+++ b/wsclient.module
@@ -93,19 +93,6 @@ function wsclient_service_load($name) {
 }
 
 /**
- * Gets configured http auth settings.
- */
-function wsclient_get_http_auth() {
-  if (($username = variable_get('wsclient_httpauth_username', NULL)) && $password = variable_get('wsclient_httpauth_password', NULL)) {
-    return array(
-      'method' => variable_get('wsclient_httpauth_method', CURLAUTH_BASIC),
-      'username' => $username,
-      'password' => $password,
-    );
-  }
-}
-
-/**
  * Access callback for operations on wsclient entities.
  *
  * @see entity_access()
diff --git a/wsclient_rest/wsclient_rest.module b/wsclient_rest/wsclient_rest.module
index caa426d..e52e6cb 100644
--- a/wsclient_rest/wsclient_rest.module
+++ b/wsclient_rest/wsclient_rest.module
@@ -37,13 +37,31 @@ class WSClientRESTEndpoint extends WSClientEndpoint {
    */
   public function client() {
     if (!isset($this->client)) {
+      // Determine which type of authentication to use.
+      $authentication = NULL;
+      if (isset($this->service->settings['authentication'])) {
+        // Handle each type of authentication.
+        foreach ($this->service->settings['authentication'] as $auth) {
+          // @todo Allow multiple authentications by implementing and using HttpClientCompositeAuth.
+          switch ($auth) {
+            case 'basic':
+            default:
+              $username = $this->service->settings['authentication']['basic']['username'];
+              $password = $this->service->settings['authentication']['basic']['password'];
+              $authentication = new HttpClientBasicAuth($username, $password);
+              break;
+          }
+        }
+      }
+      // Determine which formatter to use.
+      $formatter = NULL;
       if (isset($this->service->settings['formatter'])) {
         $formatter = new $this->service->settings['formatter']();
-        $this->client = new HttpClient(NULL, $formatter);
       }
       else {
-        $this->client = new HttpClient(NULL, new HttpClientBaseFormatter(HttpClientBaseFormatter::FORMAT_JSON));
+        $formatter = new HttpClientBaseFormatter(HttpClientBaseFormatter::FORMAT_JSON);
       }
+      $this->client = new HttpClient($authentication, $formatter);
       // Pass through additional curl options.
       if (!empty($this->service->settings['curl options'])) {
         $this->client->options['curlopts'] = $this->service->settings['curl options'];
diff --git a/wsclient_soap/wsclient_soap.module b/wsclient_soap/wsclient_soap.module
index d78da88..1afc8e2 100644
--- a/wsclient_soap/wsclient_soap.module
+++ b/wsclient_soap/wsclient_soap.module
@@ -25,6 +25,11 @@ class WSClientSOAPEndpoint extends WSClientEndpoint {
   public function client() {
     if (!isset($this->client)) {
       $options['exceptions'] = TRUE;
+      // Handle Basic HTTP authentication.
+      if (!empty($this->service->settings['authentication']['basic'])) {
+        $this->service->settings['options']['login'] = $this->service->settings['authentication']['basic']['username'];
+        $this->service->settings['options']['password'] = $this->service->settings['authentication']['basic']['password'];
+      }
       if (!empty($this->service->settings['options'])) {
         $options += $this->service->settings['options'];
       }
