OAuthProvider::timestampNonceHandler
PHP function
Edit on GitHub ✎
(PECL OAuth >= 1.0.0)
Set the timestampNonceHandler handler callback
Description
OAuthProvider::timestampNonceHandler(callable $callback_function): void
Sets the timestamp nonce handler callback, which will later be called with OAuthProvider::callTimestampNonceHandler. Errors related to timestamp/nonce are thrown to this callback.
Func
Parameters
callback_functionThe
callablefunctions name.
Return Values
Void
Examples
Example OAuthProvider::timestampNonceHandler callback
php
<?php
function timestampNonceChecker($provider) {
if ($provider->nonce === 'bad') {
return OAUTH_BAD_NONCE;
} elseif ($provider->timestamp == '0') {
return OAUTH_BAD_TIMESTAMP;
}
return OAUTH_OK;
}
?>See Also
OAuthProvider::callTimestampNonceHandler