Hi, Hoping to get a helping hand here. So this is the story. I try to authenticate from localhost (MAMP)
1. trouble when the user allows access and I look in the connected apps of that user I see "No access - App folder deleted (Pending)" on access type. Wondering if this has something to do with the next issue
2. when trying to get the user token it says: {"error_description": "No auth function available for given request", "error": "invalid_request"}
So this is my (testing code):
<p><a href="https://www.dropbox.com/oauth2/authorize?client_id=MY_APPS__APP-KEY&response_type=code&state=12345&redirect_uri=http://localhost:8888/dropbox/dropbox.php">Click here to grant access to our application</a></p>
<?php
$auth = 'MY_ACCESS_TOKEN';
if (isset($_GET['code']) && $_GET['code'] != '' ) {
$user_code = $_GET['code'];
}
echo "User code = " .$user_code . "<br />";
if (isset($user_code)) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer ' . $auth, 'Content-Type: application/x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_URL, "https://api.dropboxapi.com/oauth2/token");
curl_setopt($ch, CURLOPT_POSTFIELDS, array('code'=> $user_code, 'client_id' => "MY_APPS_APP_KEY", 'client_secret' => "MY_APPS_APP_SECRET", 'grant_type' => $user_code, 'redirect_uri' => 'http://localhost:8888/dropbox/dropbox.php'));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
fclose($fp);
echo "<br /><br /><br />";
}
?>
Hope someone can shed a light on this. Thanks in advance