diff --git a/oauth_common.rules.inc b/oauth_common.rules.inc
new file mode 100644
index 0000000..38168a2
--- /dev/null
+++ b/oauth_common.rules.inc
@@ -0,0 +1,72 @@
+<?php
+/**
+ * @file
+ * Rules module integration.
+ */
+
+/**
+ * Implements hook_rules_action_info().
+ */
+function oauth_common_rules_action_info() {
+  $actions = array();
+
+  $actions['oauth_common_consumer_add'] = array(
+    'label' => t('Add new consumer'),
+    'group' => t('OAuth'),
+    'base' => 'oauth_common_rules_actions_consumer_add',
+    'arguments' => array(
+      'account' => array(
+        'type' => 'user',
+        'label' => t('User acccount'),
+        'description' => t('The user account to add the consumer to.'),
+      ),
+      'name' => array(
+        'type' => 'text',
+        'label' => t('Consumer name'),
+        'description' => t('The name of the consumer.'),
+      ),
+      'callback_url' => array(
+        'type' => 'text',
+        'label' => t('Callback URL'),
+        'description' => t('You must include a schema for this to work correctly, ie. http:// or iphoneappname://'),
+        'optional' => TRUE,
+      ),
+      'context' => array(
+        'type' => 'text',
+        'label' => t('Application context'),
+        'description' => '',
+        'options list' => 'oauth_common_rules_action_consumer_add_allowed_contexts',
+      ),
+    ),
+  );
+
+  return $actions;
+}
+
+/**
+ * Callback for 'oauth_common_consumer_add' rules action.
+ */
+function oauth_common_rules_actions_consumer_add($account, $name, $callback_url, $context) {
+  $consumer = new DrupalOAuthConsumer(user_password(32), user_password(32), array(
+    'callback_url' => $callback_url,
+    'uid' => $account->uid,
+    'name' => $name,
+    'context' => $context,
+    'provider_consumer' => TRUE,
+  ));
+  $consumer->write();
+}
+
+/**
+ * Callback for 'oauth_common_consumer_add' rules action 'context' argument
+ * options list.
+ */
+function oauth_common_rules_action_consumer_add_allowed_contexts() {
+  $allowed_contexts = array();
+  foreach (oauth_common_context_list() as $context => $title) {
+    if (user_access(sprintf('oauth register consumers in %s', $context))) {
+      $allowed_contexts[$context] = $title;
+    }
+  }
+  return $allowed_contexts;
+}
