Search code examples
phpdropbox-php

how to logout a dropbox account with php


i am using dropbox php SDK and i want to know is there any way to logged out the dropbox account with any php function???

i am using this code using curl to logged out

function logout() 
{
    $ch = curl_init();
    $url="https://www.dropbox.com/logout";

    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    // grab URL and pass it to the browser
    curl_exec($ch);
    // close cURL resource, and free up system resources
    curl_close($ch);
}

Solution

  • This can not be achieved server side, as long there is no api existing.

    Try this:

    <iframe src="https://www.dropbox.com/logout" style="display:hidden" />
    

    If your problem is OAuth related:

    This would be related to the part of your application, where you check, if you need an OAuth Request. Simple require new Authentification there.

    For example: simple remove your Token from persistence