我正在尝试连接到Asana API
via Asana-php
。当我创建index.php
并放置需要连接的代码时,OAuth
我在尝试连接到Asana. [this is my app in Asana][1]. How do I connect to
Asana 时遇到了一些问题,或者我做错了什么。我的代码是这样的:
require '/vendor/autoload.php';
$ASANA_CLIENT_ID = getenv('my_asana_client_id');
$ASANA_CLIENT_SECRET = getenv('my_asana_client_secret');
$client = Asana\Client::oauth(array(
'client_id' => $ASANA_CLIENT_ID,
'client_secret' => $ASANA_CLIENT_SECRET,
// this special redirect URI will prompt the user to copy/paste the code.
// useful for command line scripts and other non-web apps
'redirect_uri' => 'https://chefpepper.dyndns.org/ChefPepperProjects/auth/asana/callback'
));
echo "authorized=" . $client->dispatcher->authorized . "\n";
# get an authorization URL:
$state = null;
$url = $client->dispatcher->authorizationUrl($state);`