Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Onedrive App #3

Closed
ghost opened this issue Jul 17, 2019 · 9 comments
Closed

Creating Onedrive App #3

ghost opened this issue Jul 17, 2019 · 9 comments
Labels
good first issue Good for newcomers

Comments

@ghost
Copy link

ghost commented Jul 17, 2019

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
Copy link
Owner

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
Copy link

Maverick1983 commented Jul 19, 2019

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
Copy link
Owner

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
Copy link

Maverick1983 commented Jul 19, 2019

It's my Azure.

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

@ghost
Copy link
Author

ghost commented Jul 22, 2019

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
Copy link

@arv4 You can see here nextcloud subdir configuration

@ghost
Copy link
Author

ghost commented Jul 22, 2019

@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

@ghost ghost closed this as completed Jul 22, 2019
This was referenced Sep 12, 2019
@Maverick1983
Copy link

With 1.0.5 version I have this error

image

@ozboss
Copy link

ozboss commented Apr 19, 2020

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

  • drop "/index.php"
  • replace "/user" with "/admin"

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants