Trying to use OneDrive as backup target for backup software using the V2 API, getting "Unauthorized" error message.

I'm an Office 365 Home subscriber; I've been able to backup my PC to OneDrive using the V1 API for a long while now. Since V1 is being deprecated, I'm trying to move to the V2 API, but when I try to connect using my backup app (Duplicati), I get the following message:

Failed to connect: Unauthorized: Unauthorized error from request https://graph.microsoft.com/v1.0/me/drive/root:/PC Backup/DELLXPS8500 Method: GET, RequestUri: 'https://graph.microsoft.com/v1.0/me/drive/root:/PC Backup/DELLXPS8500', Version: 1.1, Content: <null>, Headers: { User-Agent: Duplicati/2.0.4.10 Authorization: Bearer ABC...XYZ } StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { request-id: 9e6cd821-48f0-435b-a166-dca1bec189d5 client-request-id: 9e6cd821-48f0-435b-a166-dca1bec189d5 x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"North Central US","Slice":"SliceC","Ring":"3","ScaleUnit":"003","Host":"AGSFE_IN_33","ADSiteName":"NCU"}} Strict-Transport-Security: max-age=31536000 Date: Mon, 31 Dec 2018 22:24:28 GMT WWW-Authenticate: Bearer realm="", authorization_uri="https://login.microsoftonline.com/common/oauth2/authorize", client_id="00000003-0000-0000-c000-000000000000" Content-Length: 265 Content-Type: application/json; charset=utf-8 } { "error": { "code": "InvalidAuthenticationToken", "message": "CompactToken parsing failed with error code: 8004920A", "innerError": { "request-id": "9e6cd821-48f0-435b-a166-dca1bec189d5", "date": "2018-12-31T22:24:29" } } }

Any ideas what's going wrong here? The Auth page accepts my Microsoft Account email address just fine, so I don't understand how I can be "Unauthorized."

 

Question Info


Last updated June 24, 2019 Views 119 Applies to:

Hey there, Judah_Richardson

Is this an App you have been working on/developing?

"InvalidAuthenticationToken"

It looks as though its though its not communicating with Microsoft services, more importantly the Account services for Microsoft. 

Have you tried generating a new token at graph.microsoft.com?

Regards, 

Volunteer Moderator | Xbox Ambassador | Article Author | Windows & Xbox Insider

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

I'm using Duplicati as my client. It's an open source backup utility. The user selects a cloud backend and path within that backend and then enters an OAuth key for it, generated from this URL: https://duplicati-oauth-handler.appspot.com/?type=onedrivev2
Windows 10 Pro Slow Ring

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Hey there, Judah_Richardson

That has just allowed me to sign in. I had to verify I accepted the App to access my content. However, it did work. It then told me to copy and past a GUID to use. 

So everything seems to be working, in the code, anyway. 

  1. Have you tried in a different browser?
  2. Cleared the browsers cache and cookies?

Regards, 

Volunteer Moderator | Xbox Ambassador | Article Author | Windows & Xbox Insider

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Hey there, Judah_Richardson

That has just allowed me to sign in. I had to verify I accepted the App to access my content. However, it did work. It then told me to copy and past a GUID to use. 

So everything seems to be working, in the code, anyway. 

  1. Have you tried in a different browser?
  2. Cleared the browsers cache and cookies?

Regards, 

I tried a different browser and got this error message instead:

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: https://duplicati-oauth-handler.appspot.com?type=onedrivev2

However, when I follow those instructions I get the same error message again.

Windows 10 Pro Slow Ring

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

OK so I've made some slight progress since then. I went to https://account.live.com/consent/Manage and removed all Duplicati entries, then tried generating a new AuthID. Now I get this 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: https://duplicati-oauth-handler.appspot.com?type=onedrivev2

Following those instructions produces the same error. Ideas?

Windows 10 Pro Slow Ring

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Solution here: https://forum.duplicati.com/t/setting-up-onedrive-personal/588/54?u=jdrch
Windows 10 Pro Slow Ring

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.