0
は、これは私のコードです:OAuthのgetAccessToken Tumblrの
<?php
session_start();
if ($_GET['oauth_verifier'] && $_GET['oauth_token'])
{
$oauth = new OAuth(
'wvo35DiIDRY5SMfA47OpDDDW958yWckPcs00gFwQdaGtk7e###',
'LvX6zPEtNxZU4sO3BO0V7kkVxI7V0TB6CnSXfIFRKVUdTyQ###',
$_SESSION['oauth_token'],
$_SESSION['oauth_token_secret']
);
$oauth->setToken($_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
$accesToken = $oauth->getAccessToken('http://www.tumblr.com/oauth/access_token'); // ERROR LINE
$oauth->setToken($accessToken["oauth_token"],$accessToken["oauth_token_secret"]);
exit();
}
$oauth = new OAuth(
'wvo35DiIDRY5SMfA47OpDDDW958yWckPcs00gFwQdaGtk7e###',
'LvX6zPEtNxZU4sO3BO0V7kkVxI7V0TB6CnSXfIFRKVUdTyQ###',
OAUTH_SIG_METHOD_HMACSHA1,
OAUTH_AUTH_TYPE_URI
);
$requestToken = $oauth->getRequestToken('http://www.tumblr.com/oauth/request_token');
$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
header("Location: https://www.tumblr.com/oauth/authorize?oauth_token={$requestToken['oauth_token']}");
と私はエラーを持っている:
Fatal error: Uncaught exception 'OAuthException' with message 'Invalid auth/bad request (got a 400, expected HTTP/1.1 20X or a redirect)' in
私はこれをどのように修正することができます
?
ここにチェック[http://stackoverflow.com/questions/20235182/how-do-i-get-the-access-token-from-tumblrs-official-php-client]それはあなたを助けることができます –
ありがとうございます私はAPI Tumblrを使用しません、私はこのlibを使用します:[Github jaapz Tumblr](https://github.com/jaapz/Tumblr) –