diff --git a/class/Db.class.php b/class/Db.class.php index 7f04f3a..c0bffda 100644 --- a/class/Db.class.php +++ b/class/Db.class.php @@ -7,7 +7,7 @@ class Db { private static $instance; private function __construct() { - $this->pdoInstance = new PDO("mysql:host=localhost;dbname=oauthProvider","oauth","oauth"); + $this->pdoInstance = new PDO("mysql:host=localhost;dbname=oauth","oauth","oauth"); $this->pdoInstance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->pdoInstance->exec("set names 'utf8'"); } diff --git a/class/Provider.class.php b/class/Provider.class.php index f74c28d..58343d9 100644 --- a/class/Provider.class.php +++ b/class/Provider.class.php @@ -6,7 +6,7 @@ class Provider{ private $consumer; private $oauth_error; private $user; - private $authentification_url = "http://localhost/OAuthProviderExample/oauth/login.php"; + private $authentification_url = "http://workspace.local/OAuthProviderExample/oauth/login.php"; public static function createConsumer(){ $key = sha1(OAuthProvider::generateToken(20,true)); @@ -138,7 +138,7 @@ public function checkToken($provider){ if(is_null($token)){ // token not found return OAUTH_TOKEN_REJECTED; } elseif($token->getType() == 1 && $token->getVerifier() != $provider->verifier){ // bad verifier for request token - return OAUTH_VERIFIER_INVALID; + return VERIFIER_TOKEN_INVALID; } else { if($token->getType() == 2){ /* if this is an access token we register the user to the provider for use in our api */ diff --git a/client/apicall.php b/client/apicall.php index 9186791..96251b7 100644 --- a/client/apicall.php +++ b/client/apicall.php @@ -4,7 +4,7 @@ $oauth_client = new Oauth("key","secret"); $oauth_client->enableDebug(); $oauth_client->setToken($_POST['token'],$_POST['token_secret']); - $oauth_client->fetch("http://localhost/OAuthProviderExample/oauth/api/user"); + $oauth_client->fetch("http://workspace.local/OAuthProviderExample/oauth/api/user"); echo "API RESULT : ".$oauth_client->getLastResponse(); } catch (OAuthException $E){ echo $E->debugInfo; diff --git a/client/callback.php b/client/callback.php index 941956d..01ccb48 100644 --- a/client/callback.php +++ b/client/callback.php @@ -1,11 +1,11 @@ enableDebug(); $oauth_client->setToken($_POST['oauth_token'],$_POST['oauth_token_secret']); - $info = $oauth_client->getAccessToken("http://localhost/OAuthProviderExample/oauth/access_token",null,$_POST['oauth_verifier']); + $info = $oauth_client->getAccessToken("http://workspace.local/OAuthProviderExample/oauth/access_token",null,$_POST['verifier_token']); echo "