cp2004 / OctoPrint-OneDriveFileSync

Automatically sync your OctoPrint files with OneDrive
GNU Affero General Public License v3.0
5 stars 0 forks source link

OneDrive for Business #18

Open rashuge opened 1 year ago

rashuge commented 1 year ago

First off, I love your OneDrive backup plug-in. The issue I have is that I utilize OneDrive for Business. This appears to work without issues when I connect for the backup plug-in. The OneDrive File Sync, however, does not. It will only work with OneDrive personal. Any recommendations or are you willing to tweak your plug-in to accommodate? Thanks for the awesome work!

cp2004 commented 1 year ago

I had never tested the backup plugin with a business account (although I now have one I could try it with that I didn't previously). I had a couple of bug reports that seemed to be tied to the fact that they had business accounts, so I never enabled it for this plugin.

I have just updated the app registration with Microsoft to match the OneDrive Backup plugin, so it should allow both personal and business accounts. Please try and link your install again and see if it is different.

I suspect that not all business accounts work the same way, but I was never able to figure out the issue as I never had an issue myself.

cp2004 commented 1 year ago

I am not sure how long for that change to take effect, if it hasn't changed tomorrow I'll give it another look.

IronAegis90 commented 1 year ago

I too am unable to use my work account to sign in.

I noticed that the Sync plugin uses https://www.microsoft.com/link to perform the account linking but the Backup plugin uses https://microsoft.com/devicelogin. Maybe that is the difference in setup that prevents using work accounts in the Sync plugin?

If I attempt to use the Backup link with the code generated by the Sync plugin I get a 'That code didn't work. Check the code and try again.' message from Microsoft.

cp2004 commented 1 year ago

The links are generated by the microsoft authentication library, and I suspect the difference is how I registered the app in the first place now. From what I can see, the app registrations look exactly the same, with the same targets & permissions, so perhaps there's something that can't be changed now with the registration.

Over the summer when I have more time, I'll see if I can register a new app with microsoft, and maybe new users of the plugin can use that registration rather than the existing one. I can't migrate everyone without requiring re-linking MS accounts, so some tricks will be required to keep existing users working if the registration changes.