Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 615 Bytes

README.md

File metadata and controls

25 lines (19 loc) · 615 Bytes

Request Token Example

$requestURL = 'TOKEN REQUEST ENDPOINT';

$OAuth = new OAuth1_Utils;

$OAuth
->setConsumerKey('CONSUMER KEY')
->setCallback('REDIRECT URL')
->setSignature($OAuth->createSignature(
    $requestURL,
    'CONSUMER SECRET',
    null, // token secret doesn't exist yet as this is request token stage
    'POST'
));

// make a request with CURL using constructed OAuth1 payload
$curl = curl_init($requestURL . '?' . http_build_query($OAuth->getPayload()));

// or if you only need the OAuth1 signature:
$signature = $OAuth->getSignature();

For more examples, go to the /examples folder.