php8.5
Home/ Manual/ oauth / oauth/ OAuth::setToken

OAuth::setToken

PHP function Edit on GitHub ✎

(PECL OAuth >= 0.99.1)

Sets the token and secret

Description

OAuth::setToken(string $token, string $token_secret): bool

Set the token and secret for subsequent requests.

Parameters

token

The OAuth token.

token_secret

The OAuth token secret.

Return Values

true

Examples

OAuth::setToken() example

php
<?php
$oauth = new OAuth(OAUTH_CONSUMER_KEY,OAUTH_CONSUMER_SECRET);
$oauth->setToken("token","token-secret");
?>

Source: reference/oauth/oauth/settoken.xml · from the official PHP manual (php/doc-en)