diff --git a/css/services.admin.css b/css/services.admin.css
index 5f3a53d972bc13a04379e46d01ae993d5f2853b3..d7a1c93371d27fbcd4b08531da6628a83b4000ae 100644
--- a/css/services.admin.css
+++ b/css/services.admin.css
@@ -56,6 +56,12 @@ a.resource-collapse:hover {
 td.resource-group-alias {
   width:130px;
 }
+td.resource-method-select .description {
+  white-space: normal;
+}
+td.resource-method-setting .description {
+  white-space: normal;
+}
 /* Zebra colors for resources admin table */
 #resource-form-table tr.resource-even td {
   background: none repeat scroll 0 0 #F3F4EE;
diff --git a/plugins/export_ui/services_ctools_export_ui.class.php b/plugins/export_ui/services_ctools_export_ui.class.php
index 578d2eb7834564a19782875848d622c4c7e67646..110afb7ac3903e1fd779c7960729fd2a6772e46f 100644
--- a/plugins/export_ui/services_ctools_export_ui.class.php
+++ b/plugins/export_ui/services_ctools_export_ui.class.php
@@ -178,7 +178,6 @@ function services_edit_form_endpoint_server_submit($form, $form_state) {
   $definition = $servers[$endpoint->server]['settings'];
 
   $values = $form_state['values'][$endpoint->server];
-
   // Allow the server to alter the submitted values before they're stored
   // as settings.
   if (!empty($definition['submit'])) {
@@ -232,13 +231,18 @@ function services_edit_form_endpoint_resources(&$form_state, $endpoint) {
     '#value' => $endpoint,
   );
 
-    $ops = array(
+  $ops = array(
     'create'   => t('Create'),
     'retrieve' => t('Retrieve'),
     'update'   => t('Update'),
     'delete'   => t('Delete'),
     'index'    => t('Index'),
   );
+  $classes = array(
+    'actions'          => t('Action'),
+    'targeted_actions' => t('Targeted Action'),
+    'relationships'    => t('Relationship'),
+  );
 
   // Call _services_build_resources() directly instead of
   // services_get_resources to bypass caching.
@@ -246,7 +250,6 @@ function services_edit_form_endpoint_resources(&$form_state, $endpoint) {
   // Apply the endpoint in a non-strict mode, so that the non-active resources
   // are preserved.
   _services_apply_endpoint($resources, $endpoint, FALSE);
-
   $form['resources'] = array(
     '#type' => 'fieldset',
     '#title' => t('Resources'),
@@ -257,74 +260,41 @@ function services_edit_form_endpoint_resources(&$form_state, $endpoint) {
     '#theme' => 'services_resource_table',
   );
 
-  $ignoreArray = array('actions', 'relationships', 'endpoint', 'name', 'file', 'targeted_actions');
+  $form['resources']['table']['#endpoint_object'] = $endpoint;
   // Generate the list of methods arranged by resource.
-  foreach ($resources as $resource => $methods) {
-    $form['resources']['table'][$resource] = array(
+  foreach ($resources as $name => $resource) {
+    $form['resources']['table'][$name] = array(
       '#collapsed' => TRUE,
       '#collapsible' => TRUE,
     );
 
     $alias = '';
-    if (isset($endpoint->resources[$resource]['alias'])) {
-      $alias = $endpoint->resources[$resource]['alias'];
+    if (isset($endpoint->resources[$name]['alias'])) {
+      $alias = $endpoint->resources[$name]['alias'];
     }
 
-    $form['resources']['table'][$resource][$resource . '-alias'] = array(
+    $form['resources']['table'][$name][$name . '-alias'] = array(
       '#type' => 'textfield',
       '#default_value' => $alias,
-      '#name' => $resource .'-alias',
+      '#name' => $name .'-alias',
       '#size' => 20,
     );
-    foreach ($methods as $class => $info) {
-      if (!in_array($class, $ignoreArray)) {
-        if (!isset($info['help'])) {
-          $description = t('No description is available');
-        }
-        else {
-          $description = $info['help'];
-        }
-        if (isset($endpoint->resources[$resource]['operations'][$class])) {
-          $default_value = $endpoint->resources[$resource]['operations'][$class]['enabled'];
-        }
-        else {
-          $default_value = 0;
-        }
-        $form['resources']['table'][$resource][$resource .'-'. $class] = array(
-          '#type' => 'checkbox',
-          '#title' => $class,
-          '#description' => $description,
-          '#default_value' => $default_value,
-        );
+    foreach ($ops as $op => $title) {
+      if (isset($resource[$op])) {
+        $form['resources']['table'][$name][$name .'-'. $op] = _services_resource_operation_settings($endpoint, $resource, $title, $op);
       }
-      elseif ($class == 'actions' || $class == 'relationships' || $class == 'targeted_actions') {
-        foreach ($info as $key => $action) {
-          if (!isset($action['help'])) {
-            $description = t('No description is available');
-          }
-          else {
-            $description = $action['help'];
-          }
-          if (isset($endpoint->resources[$resource][$class][$key])) {
-            $default_value = $endpoint->resources[$resource][$class][$key]['enabled'];
-          }
-          else {
-            $default_value = 0;
-          }
-          $form['resources']['table'][$resource][$resource .'-'. $key .'-'. $class] = array(
-            '#type' => 'checkbox',
-            '#title' => $key,
-            '#description' => $description,
-            '#default_value' => $default_value,
-          );
-        }
+    }
+    foreach ($classes as $element => $class) {
+      if (!empty($resource[$element])) {
+        foreach ($resource[$element] as $action => $definition) {
+          $form['resources']['table'][$name][$name .'-'. $name .'-'. $action] = _services_resource_operation_settings($endpoint, $resource, $class . ' - ' . $action, $element, $action);
+         }
       }
     }
   }
-
   $form['save'] = array(
-    '#type'  => 'submit',
-    '#value' => t('Save'),
+   '#type'  => 'submit',
+   '#value' => t('Save'),
   );
   return $form;
 }
@@ -360,13 +330,12 @@ function services_edit_form_endpoint_resources_validate($form, &$form_state) {
  */
 function services_edit_form_endpoint_resources_submit($form, &$form_state) {
   $endpoint  = $form_state['values']['endpoint_object'];
-
   $existing_resources = _services_build_resources();
   // Apply the endpoint in a non-strict mode, so that the non-active resources
   // are preserved.
   _services_apply_endpoint($existing_resources, $endpoint, FALSE);
   $resources = $form_state['values'];
-  $endpoint = $form_state['values']['endpoint_object'];
+  $final_resource = array();
   foreach ($resources as $path => $state) {
     if (strpos($path, '-') === FALSE || empty($state)) {
       continue;
@@ -381,13 +350,85 @@ function services_edit_form_endpoint_resources_submit($form, &$form_state) {
     }
     // If it is action, relationship, or targeted action.
     if (isset($split_path[2])) {
-      $final_resource[$resource][$split_path[2]][$method]['enabled'] = 1;
+      $final_resource[$resource][$split_path[2]][$method] = $state;
       continue;
     }
     // If it is operation.
-    $final_resource[$resource]['operations'][$method]['enabled'] = 1;
+    $final_resource[$resource]['operations'][$method] = $state;
   }
   $endpoint->resources = $final_resource;
   services_endpoint_save($endpoint);
   drupal_set_message(t('Resources have been saved'));
 }
+
+
+/**
+ * Returns information about a resource operation given it's class and name.
+ *
+ * @return array
+ *  Information about the operation, or NULL if no matching
+ *  operation was found.
+ */
+function services_get_resource_operation_info($resource, $class, $name = NULL) {
+  $op = NULL;
+  $classes = array(
+    'actions'          => t('Action'),
+    'targeted_actions' => t('Targeted Action'),
+    'relationships'    => t('Relationship'),
+  );
+  if (isset($resource[$class])) {
+    $op = $resource[$class];
+    if (!empty($name)) {
+      $op = isset($op[$name]) ? $op[$name] : NULL;
+    }
+  }
+
+  return $op;
+}
+
+/**
+ * Constructs the settings form for resource operation.
+ *
+ * @param string $resource
+ *  The resource information array.
+ * @param string $class
+ *  The class of the operation. Can be 'create', 'retrieve', 'update',
+ *  'delete', 'index', 'actions' or 'targeted_actions' or 'relationships'.
+ * @param string $name
+ *  Optional. The name parameter is only used for actions, targeted actions
+ *  and relationship.
+ */
+function _services_resource_operation_settings($endpoint, $resource, $title, $class, $name = NULL) {
+  module_load_include('runtime.inc', 'services');
+
+  $form = array(
+    '#tree' => TRUE,
+  );
+  if ($rop = services_get_resource_operation_info($resource, $class, $name)) {
+    if (isset($rop['help'])) {
+      $description = $rop['help'];
+    }
+    else {
+      $description = t('No description is available');
+    }
+    $form['enabled'] = array(
+      '#type' => 'checkbox',
+      '#title' => $title,
+      '#description' => $description,
+      '#default_value' => !empty($rop['settings']) && $rop['settings']['enabled'],
+      '#return_value' => 1,
+    );
+    // Let authentication modules add their configuration options
+    foreach ($endpoint->authentication as $auth_module => $auth_settings) {
+      $auth_settings = isset($rop['settings'][$auth_module]) ? $rop['settings'][$auth_module] : array();
+      $settings_form = services_auth_invoke($auth_module, 'controller_settings', $auth_settings, $rop, $endpoint, $class, $name);
+      if (!empty($settings_form) && $auth_module != 'services') {
+        //$settings_form['#tree'] = TRUE;
+        $form[$auth_module] = array();
+        $form[$auth_module] += $settings_form;
+      }
+    }
+  }
+
+  return $form;
+}
\ No newline at end of file
diff --git a/services.admin.inc b/services.admin.inc
index 6b4ef45380990a0952f3468d028508a5db444ab7..05947c2e2c89acf401713c24d9b012e0adda5d28 100644
--- a/services.admin.inc
+++ b/services.admin.inc
@@ -16,6 +16,7 @@ function theme_services_resource_table($variables) {
     theme('table_select_header_cell'),
     array('data' => t('Resource'), 'class' => 'resource_method'),
     array('data' => t('Description'), 'class' => 'resource_description'),
+    array('data' => t('Settings'), 'class' => 'resource_settings'),
     array('data' => t('Alias'), 'class' => 'resource_alias'),
   );
 
@@ -29,6 +30,7 @@ function theme_services_resource_table($variables) {
 
   // Cycle through each method group and create a row.
   $rows = array();
+
   foreach (element_children($table) as $key) {
     $element = &$table[$key];
     $row = array();
@@ -57,6 +59,10 @@ function theme_services_resource_table($variables) {
       'class' => 'resource-group-description',
     );
     $row[] = array(
+      'data' => '&nbsp;',
+      'class' => 'resource-group-settings',
+    );
+    $row[] = array(
       'data' => drupal_render($element[$method_class . '-alias']),
       'class' => 'resource-group-alias',
     );
@@ -76,11 +82,12 @@ function theme_services_resource_table($variables) {
         $method = $element[$method_name];
         $row = array();
 
-        $current_js['methodNames'][] = $method['#id'];
+        $current_js['methodNames'][] = $element[$method_name]['enabled']['#id'];
 
         // Store method title and description so that checkbox won't render them.
-        $title = $method['#title'];
-        $description = $method['#description'];
+        $title = $element[$method_name]['enabled']['#title'];;
+        $description = $element[$method_name]['enabled']['#description'];
+ 
 
         unset($method['#description']);
         unset($method['#title']);
@@ -88,17 +95,28 @@ function theme_services_resource_table($variables) {
         // Test name is used to determine what methods to run.
         $method['#name'] = $method_name;
         $row[] = array(
-          'data' => drupal_render($method),
+          'data' => drupal_render($method['enabled']),
           'class' => 'resource-method-select',
         );
         $row[] = array(
-          'data' => '<label for="' . $method['#id'] . '">' . $title . '</label>',
+          'data' => '<label for="' . $element[$method_name]['enabled']['#id'] . '">' . $title . '</label>',
           'class' => 'resource-method-label',
         );
         $row[] = array(
           'data' => '<div class="description">' . $description . '</div>',
           'class' => 'resource-method-description',
         );
+        $endpoint = $table['#endpoint_object'];
+        if(is_array($endpoint->authentication)) {
+          $auth_settings_form = '';
+          foreach ($endpoint->authentication as $auth_module => $auth_settings) {
+            $auth_settings_form .= drupal_render($element[$method_name][$auth_module]);
+          }
+        }
+        $row[] = array(
+          'data' => $auth_settings_form,
+          'class' => 'resource-method-setting',
+        );
         $row[] = array(
           'data' => '<div class="alias">&nbsp;</div>',
           'class' => 'resource-method-alias',
diff --git a/services.resource_build.inc b/services.resource_build.inc
index 94b737ef33c7d1b70d5460f7c1d1fec5905b7f15..26ea50cf726677a1b8fe0cf657f10378aeafa61d 100644
--- a/services.resource_build.inc
+++ b/services.resource_build.inc
@@ -95,7 +95,6 @@ function _services_apply_endpoint(&$resources, $endpoint, $strict = TRUE) {
   foreach ($resources as $name => &$resource) {
     $cres = ($endpoint && isset($endpoint->resources[$name])) ? $endpoint->resources[$name] : array();
     $resource['endpoint'] = $cres;
-
     if ($strict && empty($cres)) {
       unset($resources[$name]);
     }
@@ -104,7 +103,7 @@ function _services_apply_endpoint(&$resources, $endpoint, $strict = TRUE) {
       foreach ($crud as $op) {
         if (isset($resource[$op])) {
           $cop = isset($cres['operations'][$op]) ? $cres['operations'][$op] : array();
-          $resource[$op]['endpoint'] = $cop;
+          $resource[$op]['settings'] = $cop;
           if ($strict && (empty($cop) || !$cop['enabled'])) {
             unset($resource[$op]);
           }
@@ -115,14 +114,14 @@ function _services_apply_endpoint(&$resources, $endpoint, $strict = TRUE) {
       foreach ($classes as $class) {
         if (!empty($resource[$class])) {
           foreach ($resource[$class] as $op => $def) {
-            $cop = isset($cres[$class][$op]) ? $cres[$class][$op] : array();
+            $cop = isset($cres[$op][$name]) ? $cres[$op][$name] : array();
             if (empty($cop) || !$cop['enabled']) {
               if ($strict) {
                 unset($resource[$class][$op]);
               }
             }
             else {
-              $resource[$class][$op]['endpoint'] = $cop;
+              $resource[$class][$op]['settings'] = $cop;
             }
           }
         }
