4 * This file is (c) Copyright 2010 by Olivier BERGER, Madhumita DHAR, Institut TELECOM
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * This program has been developed in the frame of the COCLICO
21 * project with financial support of its funders.
27 require_once '../../../env.inc.php';
28 require_once '../checks.php';
30 oauthprovider_CheckAdminExit();
34 <h3>OAuth endpoints</h3>
36 <p>This OAuthProvider plugin provides the following OAuth endpoints for OAuth consumers to use, in "3-legs" mode.</p>
39 $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") ? 'http' : 'https';
40 $http_url = $scheme . '://' . $_SERVER['HTTP_HOST'];
44 <li><b>Request Token URL:</b> <tt><?php echo $http_url . '/plugins/'.$pluginname.'/request_token.php' ?></tt> (GET)</li>
45 <li><b>User Authorization URL:</b> <tt><?php echo $http_url . '/plugins/'.$pluginname.'/authorize.php' ?></tt></li>
46 <li><b>Access Token URL:</b> <tt><?php echo $http_url . '/plugins/'.$pluginname.'/access_token.php' ?></tt></li>
49 <p>For instance, with Zend_Oauth, in PHP, the consumer should use such code to request a token :<pre><tt>
50 $consumer = new Zend_OAuth_Consumer($config);
51 $consumer->setRequestMethod(Zend_Oauth::GET);
52 $consumer->setRequestTokenUrl($BASE_FF_URL.'/plugins/oauthprovider/request_token.php');
53 $customServiceParameters= array(
57 $token = $consumer->getRequestToken($customServiceParameters);</tt></pre></p>
59 <h3>Signature method</h3>
61 <p>The <b>HMAC_SHA1</b> signature method is the only one supported at the moment.</p>
65 # Create a basic href link to the manage.php plugin page
66 echo '<a href="', '/plugins/'.$pluginname.'/consumer.php' , '">', 'Consumers', '</a><br> ';
67 echo '<a href="', '/plugins/'.$pluginname.'/request_tokens.php?type='.$type.'&id='.$id , '">', 'Request tokens', '</a><br> ';
68 echo '<a href="', '/plugins/'.$pluginname.'/access_tokens.php?type='.$type.'&id='.$id , '">', 'Access tokens', '</a><br> ';
70 site_project_footer(array());