You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use Kunnu\Dropbox\Dropbox;
use Kunnu\Dropbox\DropboxApp;
//Dropbox author
add_action('wp_ajax_dropbox_user_getauth', 'dropbox_user_getauth');
function dropbox_user_getauth(){
// echo 'Dropbox Auth';
session_start();
require_once(plugin_dir_path(__FILE__).'vendor/autoload.php');
//Configure Dropbox Application
$app = new DropboxApp("xxxxxxxxx", "xxxxxxxxxxx");
//Configure Dropbox service
$dropbox = new Dropbox($app);
//DropboxAuthHelper
$authHelper = $dropbox->getAuthHelper();
//Callback URL
$callbackUrl = "https://dev.audiotext.com/wp-admin/admin-ajax.php?action=dropbox_user_getauth";
// var_dump($authHelper);
//Fetch the Authorization/Login URL
$authUrl = $authHelper->getAuthUrl($callbackUrl);
echo "<a target='_blank' href='" . $authUrl . "'>Log in with Dropbox</a>";
if (isset($_GET['code']) && isset($_GET['state'])) {
//Bad practice! No input sanitization!
$code = $_GET['code'];
$state = $_GET['state'];
//Fetch the AccessToken
$accessToken = $authHelper->getAccessToken($code, $state, $callbackUrl);
echo $accessToken->getToken();
}
}
someone know what my fault
i used localhost https anyway
==========HERE MY ERROR LOG====================
// if ($tokenInStore !== $csrfToken) {
// throw new DropboxClientException("Invalid CSRF Token. CSRF Token Mismatch.");
// }
AFTER I REMOVE THAT DECISION I GET TOKEN AND IT CAN BE USE 🤣
The text was updated successfully, but these errors were encountered:
I can't get the token even i click allow
someone know what my fault
i used localhost https anyway
==========HERE MY ERROR LOG====================
// if ($tokenInStore !== $csrfToken) {
// throw new DropboxClientException("Invalid CSRF Token. CSRF Token Mismatch.");
// }
AFTER I REMOVE THAT DECISION I GET TOKEN AND IT CAN BE USE 🤣
The text was updated successfully, but these errors were encountered: