summaryrefslogtreecommitdiffstats
path: root/settings/oauth.php
diff options
context:
space:
mode:
authorTom Needham <tom@owncloud.com>2012-07-30 10:25:41 +0000
committerTom Needham <tom@owncloud.com>2012-07-30 10:25:41 +0000
commit5933d4390107224071f8265afd81222b69f98de7 (patch)
tree9b792bf12b920b705d82d384b5f61e05e269619a /settings/oauth.php
parent038af7e636ad8a2dc9ac342eaecd176cc5c35256 (diff)
downloadnextcloud-server-5933d4390107224071f8265afd81222b69f98de7.tar.gz
nextcloud-server-5933d4390107224071f8265afd81222b69f98de7.zip
Basic template for authorising exernal apps with OAuth
Diffstat (limited to 'settings/oauth.php')
-rw-r--r--settings/oauth.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/settings/oauth.php b/settings/oauth.php
new file mode 100644
index 00000000000..bcf34b04af6
--- /dev/null
+++ b/settings/oauth.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Copyright (c) 2012, Tom Needham <tom@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
+require_once('../lib/base.php');
+
+// Logic
+$operation = isset($_GET['operation']) ? $_GET['operation'] : '';
+switch($operation){
+
+ case 'register':
+
+ break;
+
+ case 'request_token':
+ break;
+
+ case 'authorise';
+ // Example
+ $consumer = array(
+ 'name' => 'Firefox Bookmark Sync',
+ 'scopes' => array('bookmarks'),
+ );
+
+ $t = new OC_Template('settings', 'oauth', 'guest');
+ $t->assign('consumer', $consumer);
+ $t->printPage();
+ break;
+
+ case 'access_token';
+ break;
+
+ default:
+ // Something went wrong
+ header('Location: /');
+ break;
+
+}