hevelius / files_external_onedrive

:mega: :floppy_disk: External storage support for Microsoft OneDrive
GNU General Public License v2.0
72 stars 21 forks source link

Creating Onedrive App #3

Closed ghost closed 5 years ago

ghost commented 5 years ago

I tried to create a onedrive app, but I encountered several problems.

Azure does not accept the Authentication Redirect URI http://path/to/nextcloud/index.php/settings/admin?sectionid=storage. I am getting the error message: Does not contain query strings Also the URL must start with HTTPS. Maybe the Redirect URI should be https://path/to/nextcloud/index.php/settings/admin/externalstorages?

After clicking "Grant access" in my Nextcloud installation nothing happens. An XHR request gets send to http://path/to/nextcloud/index.php/apps/files_external/ajax/oauth2.php, but I don't get redirected or get any error message.

I am using Nextcloud 16.0.1

hevelius commented 5 years ago

The correct paths are https://path/to/nextcloud/index.php/settings/user/externalstorages https://path/to/nextcloud/index.php/settings/admin/externalstorages

without querystring.

Sorry the instructions to configuring Azure is a little confused. I hope to work on as soon as possible.

For the XHR request is there any error on your browser console?

Maverick1983 commented 5 years ago

Not working when click "Grand access". I will redirect to microsoft login and immediatly I receve error on attach file. Error

I have Client Id configured

Error2

hevelius commented 5 years ago

Not working when click "Grand access". I will redirect to microsoft login and immediatly I receve error on attach file. Error

I have Client Id configured

Error2

seems to be a mistake on azure... Have you give right permissions?

Maverick1983 commented 5 years ago

It's my Azure.

RESOLVED. Must select this option, when create App Registrations on Azure Error3

ghost commented 5 years ago

Found an error maybe realated to my problem. My Nextcloud tries to load a script from a nonexistent location. It is installed into "subdirectory", but tries to load a script from "subdirectory//subdirectory"

Loading failed for the <script> with source “https://example.com/subdirectory//subdirectory/apps/files_external_onedrive/js/onedrive.js?v=241bed0d-0”.

Maverick1983 commented 5 years ago

@arv4 You can see here nextcloud subdir configuration

ghost commented 5 years ago

@Maverick1983 my Nextcloud works fine, it's just this one script.

The problem is in files_external_onedrive/lib/Backend/OneDrive.php The javascript file onedrive.js does not load correctly if you install Nextcloud in a subfolder. My solution to fix this issue: https://gist.github.com/arv4/319079995097d17a4a73f257a3448132

Maverick1983 commented 4 years ago

With 1.0.5 version I have this error

image

ozboss commented 4 years ago

With 1.0.5 version I have this error

image

I get the same error.

EDIT: This works: https://path/to/nextcloud/settings/admin/externalstorages