nextcloud / nextcloud/integration_onedrive

Onedrive Integration - Client secret getting truncated

Open
#99 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
41
Forks
12
Avg merge
6d 16h
Merged PRs (30d)
4

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

When configuring the OneDrive integration in Nextcloud (running as an official app on TrueNAS SCALE), the Client Secret entered in the admin settings gets truncated or lost after saving.
As a result, OAuth authentication fails with:

OneDrive OAuth error : Client error: POST https://login.live.com/oauth20_token.srf resulted in a 400 Bad Request response:
{"error":"invalid_client","error_description":"The provided value for the 'client_secret' parameter is not valid."}

Steps to reproduce
    1.	Install official Nextcloud app on TrueNAS SCALE (24.10 or later).
2.	Go to Settings → Administration → Connected accounts → OneDrive.
3.	Enter valid values for:
       •	Client ID
       •	Client Secret (from Azure App Registration)
       •	Redirect URI correctly set to
                     https://<your-domain>/apps/integration_onedrive/oauth-redirect
4.	Click Save.
5.	Try connecting a user account or re-open the settings.
Expected behaviour

The full Client Secret value should be saved and used for OAuth token exchange.

Actual behaviour

The Client Secret gets truncated or lost after saving, leading to invalid_client OAuth errors.
In some cases, checking the config.php shows the value is partially saved or replaced by an empty string.

Server configuration

Operating system: TrueNAS SCALE 25.0.4.3 (Fangtooth)
Web server: Embedded nginx (TrueNAS Nextcloud App)
Database: PostgreSQL
PHP version: 8.2
Nextcloud version: 32.0.0.13
App version: integration_onedrive 1.0.x
Installation method: Official TrueNAS SCALE App
Reverse proxy: Cloudflare Tunnel

List of activated apps
Default apps
External Storage
Onedrive integration

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Yes

Nextcloud configuration 'overwrite.cli.url' => 'https://nextcloud.gosavifamily.net', 'trusted_domains' => [ 0 => '127.0.0.1', 1 => '192.168.50.xxx', 2 => 'localhost', 3 => 'nextcloud', 4 => 'nextcloud.gosavifamily.net', ], 'dbtype' => 'pgsql', 'version' => '32.0.0.13', 'config_preset' => 2, 'preview_imaginary_url' => 'http://imaginary:9000', ``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder ``` Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the save flow in the OneDrive administration settings, then inspect config.php and the app's occ configuration output to compare the entered and stored secret. Verify the OAuth token request at login.live.com/oauth20_token.srf uses the complete value; done means the secret persists after saving and authentication succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
authentication, backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.