PHP 8.3.4 Released!

OAuthProvider::tokenHandler

(PECL OAuth >= 1.0.0)

OAuthProvider::tokenHandler设置 tokenHandler 句柄回调函数

说明

public OAuthProvider::tokenHandler(callable $callback_function): void

设置令牌句柄的回调函数,此回调函数将在后面被 OAuthProvider::callTokenHandler() 调用。

警告

本函数还未编写文档,仅有参数列表。

参数

callback_function

回调类型 的函数名。

返回值

没有返回值。

示例

示例 #1 OAuthProvider::tokenHandler() 回调的例子

<?php
function tokenHandler($provider) {

if (
$provider->token === 'rejected') {
return
OAUTH_TOKEN_REJECTED;
} elseif (
$provider->token === 'revoked') {
return
OAUTH_TOKEN_REVOKED;
}

$provider->token_secret = "the_tokens_secret";
return
OAUTH_OK;
}
?>

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top