2 /***********************************************************************/
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
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 /***********************************************************************/
15 require_once('OAuth.php');
16 require_once('../Shindig/ATutorOAuthDataStore.php');
18 $oauthDataStore = new ATutorOAuthDataStore();
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);
27 echo $token->to_string();
30 } catch (OAuthException $e) {
31 echo $e->getMessage();
32 } catch (Exception $e) {
33 echo $e->getMessage();