Studio-42 / elFinder

📁 Open-source file manager for web, written in JavaScript using jQuery and jQuery UI
https://studio-42.github.io/elFinder/
Other
4.64k stars 1.41k forks source link

elFinder and Dropbox2 plugin > error errReauthRequire #3067

Closed osworx closed 4 years ago

osworx commented 4 years ago

Using elFinder 2.1.50, enabled DropBox2, correct credentials. netDriver is enabled, the 2 define(..) are set correctly. Dropbox sdk is added via composer. Added a net drive to the roots array:

array(
            'driver'            => 'Dropbox2',
            'consumerKey'       => 'KEY',
            'consumerSecret'    => 'SECRET',
            'path'          => '/'
        )

Now when I want to establish the connection, all what I recieve is an error (inside the authentication window and after successful authentification) telling me that:

{
  "exit": true,
  "error": "errReauthRequire"
}

Did I miss something?

Note: when providing an access_token (array roots) no authentification is required, the Dropbox mount works perfectly (but is permanent). Which means, I have added all files and set configuration correct.

nao-pon commented 4 years ago

@osworx As you say, an access token is required for a permanent mount. In what situation did the error you indicated have been reported? When using a network mount, there is no need to define it in the roots array.

osworx commented 4 years ago

@nao-pon Error came when I defined Dropbox2 without the access_token (but funding that option was a long journey !): 2 x define and

$roots[] = [
    'driver'        => 'Dropbox2',
    'consumerKey'       => 'KEY',
    'consumerSecret'    => 'SECRET',
    'path'          => '/'
];

Additonal the return (authentification) URL did not work (as with all ! - but see additional issue report), only the additional opened window was visible and after successfull verification and granting access to dropbox the json data was visible.

The moment I added the access_token to the $roots array, the connection worked - but was permanent.

nao-pon commented 4 years ago

@osworx Yes, that's right. An access token is required for permanent mounting.

osworx commented 4 years ago

You are closing this issue, but what about the error (bug):

"error": "errReauthRequire"

when NOT using a permanent connection?

nao-pon commented 4 years ago

If you set a permanent mount with the dropbox2 driver and the access token is missing, the following mount error will be reported:

Driver "elFinderVolumeDropbox2" : Required option "access_token" or "refresh_token" is undefined.

osworx commented 4 years ago

@nao-pon You are mixing 2 cases.

  1. my initial post was with this settings (no permanent connection):
array(
    'driver'            => 'Dropbox2',
    'consumerKey'       => 'j1xxxxxxxxxxxxxxxx',
    'consumerSecret'    => 'g5xxxxxxxxxxxxxxxxx',
    'path'          => '/'
)

If set these - without a permanent (access_token) definition, this error is shown:

errReauthRequire

  1. defining a permanent connection is done by defining like this (w. comments to help others):
array(
    'driver'            => 'Dropbox2',
    // same as app_key
    'consumerKey'       => 'j1xxxxxxxxxxxxxxxx',
    // same as app_secret
    'consumerSecret'    => 'g5xxxxxxxxxxxxxxxxx',
    // optional (if created) - use this to establish a permanent connection
    'access_token'      => 'hT_xxxxxxxxxxxxxxxxxxxxxxx',
    'path'              => '/'
)

and that works perfectly (without any error).

btw: the errReauthRequire is always given at initialization only (callling elFinder the first time) for each net drives. And clear why, because at this stage no authentification is made, only the popup is called ... which loops through all net drive settings and start the functions in the background without any reason .. (see other issue report here).

nao-pon commented 4 years ago
array(
    'driver'            => 'Dropbox2',
    'consumerKey'       => 'j1xxxxxxxxxxxxxxxx',
    'consumerSecret'    => 'g5xxxxxxxxxxxxxxxxx',
    'path'          => '/'
)

It make an error next... 191229-174941

errReauthRequire

Where is shown?