OAuthProvider::tokenHandler

(PECL OAuth >= 1.0.0)

OAuthProvider::tokenHandlerEstablece el manejador callback de tokenHandler

Descripción

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

Establece el token del callback, que será llamado después con OAuthProvider::callTokenHandler().

Advertencia

Esta función está actualmente no documentada; solo la lista de sus argumentos está disponible.

Parámetros

callback_function
El nombre de la función callable.

Valores devueltos

No se retorna ningún valor.

Ejemplos

Ejemplo #1 Ejemplo del callback 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;
}
?>

Ver también