最近我遇到了pinterest api的问题,我正在使用一个库来帮助我,下面是我的简单脚本来授权我的应用程序。
我使用的库是this one
我会在那里询问这个问题是否与库本身有什么关系,因为它一直有效,直到我撤销了测试它的访问权限,因为它从未授权。
代码将我重定向到登录页面并显示正确的范围,但是当我开始并进入pinterest页面时,它不会显示任何授权的应用程序。
提前谢谢。
用于连接的代码:
<?php
session_start();
require "vendor\autoload.php";
use Pinterest\App\Scope;
$client = new Pinterest\Http\BuzzClient();
$auth = new Pinterest\Authentication($client, 'i have my cliend id here', 'i have my client secret here');
$url = $auth->getAuthenticationUrl(
'i have my redirect uri here',
array(
Scope::READ_PUBLIC,
Scope::WRITE_PUBLIC,
Scope::READ_RELATIONSHIPS,
Scope::WRITE_RELATIONSHIPS,
),
'random-string'
);
header('Location: ' . $url);
exit;
?>
之后是一个简单的回调页面,它将访问令牌收集到数据库中,然后显示用户的基本信息。