I added my personal OneDrive account using Settings > Online Accounts > Microsoft 365. When it asked for the Client ID and Tenant ID I just left them blank. I linked my account and allowed Gnome access when it asked.
The problem I am having is that I can click on my Microsoft Account in Files, and I can even browse through the folders and see all the files. However, when I try to open a file I get an error. Most apps report it as an “HTTP Error: Unauthorized”. LibreOffice gives the most information and says both the error code and message are “unauthenticated”.
When I open my terminal and do ls -l I can see that the files are rw for the user and that the user and group are correctly my username.
I also noticed that if I right click on a file in Files and select Properties, under Permissions it says None. If I click on Permissions to get more information, it says `Unknown Permissions. The permissions of “myfile.txt” could not be determined.
Is anyone able to successfully use a personal OneDrive account and open or edit their files?
Do I maybe have an older version of Gnome? When I click on Microsoft 365 in the Online Accounts section I don’t see the first switch. All I see is this:
Hi everyone. I appreciate the responses, but I don’t think my issues is a question of how to add the account.
I believe I’ve correctly added the account, but there is still some issue with accessing the files. I’m able to successfully add the account and browse and see all my files and folders, but I’m just not able to open them.
Maybe LibreOffice doesn’t use GIO to access the files but instead tries to open the URL itself. In that case that would almost certainly fail for URL schemas that are not supported by LibreOffice itself or require authentication.
You can try copying the libreoffice .desktop files from /usr/share/applications/ to ~/.local/share/applications/ and then edit them to change the Exec key to use %F instead of %U to force going through GIO/GVFS via the fuse daemon by stopping it from claiming that it supports URLs.
I believe something has changed this month either in a recent February 2025 package upgrade to Ubuntu 24.04, or some change on the Microsoft side.
Reason I say this is that I have been reading and writing files to my OneDrive folder for several months on multiple Ubuntu 24.04 machines up until 18-Feb-25.
I’m only piecing this together now because I’ve been away from the computers due to vacation. Here’s what I remember from mid-month and where I stand today:
Around mid-February, Microsoft started sending me several emails a day with login PIN numbers for log-in attempts to my Microsoft account I didn’t initiate. I never had that before, but I imagine invalid login attempts using my ID have been happening for years. To put a stop to those messages, I enabled the MS Authenticator app for a week, which indeed stopped those notifications.
Once I returned to work and noticed that my OneDrive files couldn’t be opened locally – but were visible – I deactivated the Authenticator app thinking that had to be root-cause of my problem. Unfortunately, I get the same error now as the original OP which is how I found this thread.
I thought maybe this was self-inflicted be me starting to use the MS Authenticator app. But I turned that off. Also, I get the same error when connecting to another Microsoft account that never used the authenticator app, and it’s an account I never logged into using any of my Ubuntu machines.
At present, I’m on 24.04.2 LTS. And @Sid says it’s working on 24.04.1 LTS.
Using Timeshift, I just rolled back to 24.04.1 from 14-Feb-25 and still experience the issue.
This doesn’t seem to have much to do with GNOME Online Accounts, otherwise I would expect the user to be notified of expired credentials. I’d recommend opening a report in gvfs (https://gitlab.gnome.org/GNOME/gvfs/-/issues), which may get picked up by libmsgraph if necessary.
Also, yesterday my wife complained to me that she can’t access my shared OneDrive folder on her Windows 11 computer.
This now makes me feel its unrelated to GNOME, and likely a change in the Microsoft ecosystem. Fortunately if it is broken for Win 11 users, maybe a fix on the Microsoft side will come swiftly.