remove old readme
[atutor.git] / mods / _standard / social / lib / OAuth / access_token.php
1 <?php
2 /***********************************************************************/
3 /* ATutor                                                                                                                          */
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010                                             */
6 /* Inclusive Design Institute                                          */
7 /* http://atutor.ca                                                                                                        */
8 /*                                                                                                                                         */
9 /* This program is free software. You can redistribute it and/or           */
10 /* modify it under the terms of the GNU General Public License             */
11 /* as published by the Free Software Foundation.                                           */
12 /***********************************************************************/
13 // $Id$
14
15 require_once('OAuth.php');
16 require_once('../Shindig/ATutorOAuthDataStore.php');
17
18 $oauthDataStore = new ATutorOAuthDataStore();
19
20 try {
21   $server = new OAuthServer($oauthDataStore);
22   $server->add_signature_method(new OAuthSignatureMethod_HMAC_SHA1());
23   $server->add_signature_method(new OAuthSignatureMethod_PLAINTEXT());
24   $request = OAuthRequest::from_request();
25   $token = $server->fetch_access_token($request);
26   if ($token) {
27         echo $token->to_string();
28   }
29   echo $token;
30 } catch (OAuthException $e) {
31   echo $e->getMessage();
32 } catch (Exception $e) {
33   echo $e->getMessage();
34 }
35 ?>