OAuthProviderExample
OAuthProviderExample copied to clipboard
Fixed some issues with the demo client
Hi,
In the comments on you post http://djpate.com/2011/01/13/how-to-write-a-complete-oauth-provider-in-php5/ I noticed you renamed oauth_verifier to verifier_token. This commit just reflects it in the client example.
Cheers, Christoph
Hey thanks for the PR :)
I added a small note on your commit.
I am using this function for checking nonce
public function checkNonce($provider) {
if ($this->oauth->timestamp > (time() + 5*60))
{
return OAUTH_BAD_TIMESTAMP;
}
elseif ($this->consumer->hasNonce($provider->nonce, $this->oauth->timestamp)) {
return OAUTH_BAD_NONCE;
}
else {
$this->consumer->addNonce($this->oauth->nonce, $this->oauth->timestamp); //Insert a new nonce
to the DB
return OAUTH_OK;
}
}
But somehow it not working for older time stem.
It allow to response all the generated token which is older then 5 minutes.
Can you pleas help me what i am doing wrong here ?