Setting up OneDrive (personal)

hosting-services

#42

If the auth link was broken in general others wouldn’t have been reporting successful transitions so I’m guessing it’s something specific to your situation.

Did you try getting another auth key since your current one isn’t working?


#43

Although I would have expected a different error than “Unauthorized”, please be sure you fill this out with the address you want. It’s also simpler to click the “AuthID” link in Duplicati job’s “Destination” screen than to use manual access to Duplicati Oauth Handler (and have to copy the AuthID manually). It should work either way.

How we get along with OAuth explains how Duplicati doesn’t handle your username (email) or password, and looking at the “Sign in”, you will see it’s a Microsoft page. How do I enable and disable Autofill in my browser? explains how you can disable autofill for a test. Autofill: What web devs should know, but don’t is tech details.

The test I ran has both in operation, on different jobs, so at least here the answer is that revoke isn’t needed. This was on my consumer OneDrive, which I suspect is what you have. Is manual URL onedrive.live.com?


#44

I did.

Did that too.

Yes, I use consumer OneDrive and that’s the URL. But the AuthID url is login.microsoftonline.com, which I’ve never seen before anywhere else. I think that’s what’s prompting the autofill (BTW, I don’t use the autofilled email address; I clear it from the field and use the intended consumer email address.) But I suspect the reason the Auth code is invalid is because the login.microsoftonline.com portal is not intended for Office 365 Home subscribers. Is there another one I should be using instead?

EDIT: I tried using a different browser instead and now I get this error message:

Failed to connect: Failed to authorize using the OAuth service: Invalid authid in query. If the problem persists, try generating a new authid token from: Duplicati OAuth Handler

Following the instructions just gives the same error message again.


#45

Multiple times, on different browsers. Each new key is rejected in the same manner. The only thing that has changed the error message so far is switching to Chrome, but the login is still rejected on that browser too. Do you know if the Auth link is specific only to a certain type of OneDrive account? Mine is an Office 365 Home annual subscription. Is it supposed to work for that account type, or is there a different URL for users like myself?


#46

Just tried a different browser profile so that I’d have to sign into OneDrive from scratch and got the same error message.

Another thing: my OneDrive is protected by 2FA. Does this AuthID method support that?


Mega.nz error when check connection: Bad Username/-26/ResourceNotExists
#47

I think I saw some other people mention having issues with two factor authentication - though I think that was before the switch to the new API.

Have you checked out this to topic yet?


#48

The v1 API supported 2FA just fine. Literally all my problems with connecting started after it was deprecated.

1st time seeing that thread. I’ve commented there asking the person who managed to solve the issue on their end how they did it. Thanks for the link.


#49

For three shots in the dark.

  1. Try it from the Duplicati OAuth Handler directly instead of on Destination screen, and carefully copy.

  2. Go to https://account.live.com/consent/Manage and look over the Duplicati entry or entries, or if you feel more comfortable navigating, go to your account’s Privacy settings to find " Apps and services". Probably Duplicati would have below, but probably there was a consent page shown at first creation.

  • Access OneDrive files

  • Maintain access to data you have given Duplicati access to

  1. Invalid authid in query which you were seeing is interesting because AuthID is a Duplicati term, which from source looks superficially (but I also just tested it) like it means your AuthID lacked a colon. Don’t post it here, but do you see any colon in the rest of the random-appearing numbers and letters?

Or maybe this will remain a mystery until the person who got it going says what it actually took to get it going.


#50

Did that multiple times before, no luck.

OK, this was productive. I removed 2 Duplicati entries and then generated a new AuthID in Duplicati settings. Now I get a new (albeit shorter) error message:

Failed to connect: Failed to authorize using the OAuth service: Server error. If the problem persists, try generating a new authid token from: Duplicati OAuth Handler

I’ve since generated a new one and still get the same error message. Any ideas?

And yes, my AuthID code has a colon :slight_smile:

FWIW, I created a matching support thread for this on Microsoft Answers.


#51

The Microsoft Answers thread didn’t mention 2FA (if you’re still using it). Although I’m not sure how that looks in Graph API, do you recall your previous interaction? It would seem like it would have to be somewhere around a Microsoft screen. Duplicati doesn’t handle any 2FA details, and I doubt it even knows that you want to use 2FA, however I’d sort of hope Microsoft doesn’t let it just slide in, if your account is configured for it to be required…


#52

FWIW, I’m having the EXACT same problem as @jdrch, right down to the symptom that the email that shows up initially is my enterprise email, not my consumer onedrive MSA email.

I don’t have any answers but happy to test out suggestions.


#53

Success!
When you are on the Duplicati backup destination screen, it appears that Duplicati is adding an extra (redundant?) authid header in the advanced options. If you delete this advanced option, then generate a new authid, then click test, it seems to now work.


#54

You’re gonna die laughing, but the reverse just worked for me. Brilliant idea. Full start to finish steps, for anyone else with the problem:

  • Go to https://account.live.com/consent/Manage and search the page for “Duplicati.”
  • Click on each Duplicati entry from the above page
  • In the page that loads afterwards, click Remove. Repeat this until all Duplicati entries on the Manage page are gone
  • In the Duplicati web UI, under Backup Destination, select Microsoft OneDrive V2
  • In path, enter the folder path of the backup in the format Folder/ChildFolder. There are no symbols, indicators, or characters necessary for the root directory.
  • Click the AuthID link and sign into your Microsoft Account
  • Grant Dupilcati permissions in the dialog that pops up. This should automatically populate the AuthID field
  • Expand Advanced Options
  • Expand Add advanced option drop down menu
  • Under Microsoft OneDrive V2, select authid: the authorization code
  • In the authid field that opens up above the Add advanced option menu, copy and enter the AuthID generated from the link. Ensure the same AuthID is in the AuthID field under the Backup destination heading.
  • Click Test Connection. You’ll get an error message about “duplicate authid”, but ignore it. The test should be successful.
  • Set up the rest of the backup as the documentation specifies
  • Run the backup and check the live verbose log to ensure there isn’t any connection error.
  • After that backup has completed successfully, go back to the Advanced Options setting and remove the authid entry.
  • Test the connection again. It should pass with no errors.
  • Click Next until you can save the config.
  • Click Save to save the config.

Detailed guide to set up OneDrive Personal with 2FA
#55

Wow… The AuthID that is entered in the dialog for setting up the backend is encoded into a “connection url”, so it will look something like onedrivev2://folder/subfolder?authid=abc:123.

The idea is that a service wanting to support Duplicati backups can have a button for “copy connection url” that you can paste in and have it all configured.

It should work such that the query parameters from the url override the advanced options, meaning that the override you put into the Advanced options should be ignored, as the url parameters take precedence.

I was guessing that it was an encoding issue, but since it works after you remove the advanced options, it must be something else.

It could be that it is simply the OAuth process that is unstable. I often see in the logs that OAuth fails for all requests towards a specific provider (e.g. Microsoft) for a period, and then starts working again with no change on my side.


Mega.nz error when check connection: Bad Username/-26/ResourceNotExists
Problems with ":" sign in a command line export
#56

Hi, may be the same problem:
https://forum.duplicati.com/t/problems-with-sign-in-a-command-line-export/5951/5


#57

You are the man!
Similar to jdrch, I went to https://account.live.com/consent/Manage, removed all Duplicati entries. And then I did what you suggested and it works. Thanks!