Nextcloud OAuth2 provider for javascript

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): latest as of today
Operating system and version (eg, Ubuntu 17.04):
Apache or nginx version (eg, Apache 2.4.25): docker-compose with apache behind traefik
PHP version (eg, 7.1):

The issue you are facing:
I am trying to use Nextcloud as a OAuth provider for a frontend site using vuejs. I didn’t succeed in finding enough information to get it working with any OAuth package I found. I did add an entry in the Admin->security->OAuth section and get an ID and secret.

From my readings it seems that Nextcloud only allow code workflow and not credential.

I’d appreciate any point to a working solution to ue OAuth in javascript.

On the other hand I’d also would like to be able to put to and get files from my js app. I understand that I will have to use webdav for this? Is it possible to cope with auth with webdav?

Thanks

To follow up a bit, as it was very late when I posted.

I am trying to follow the instruction of the simple-Oauth2 npm package with the autorization code workflow and using the autorize endpoint https://my-nextcloud-instance/index.php/apps/oauth2/authorize. But when I get to the created uri with the secret I am just redirected to my dashboard if I am connected to nextcloud or else to the login page then to the dashboard.

What is the problem? May it come from the apache configuration? I didn’t expose the apache config volume in my docker compose so I don’t know if the config is correct (in particular, it seems that modenv and moderewrite should be enable? The doc says nothing about it).

Thanks

1 Like

did you found a solution ?