Setting up Onedrive with Sharepoint 2019 on-premise - getting "There was a problem connecting to OneDrive" with Error Code: 0x8004de40

Serban 16 Reputation points
2021-02-16T08:48:28.25+00:00

Hi,

I have a company network with some SharePoint 2019 installation, and I'm trying to setup OneDrive with that SharePoint.
I installed OneDrive, but after this the internet connection for the network is disabled, and I only have access to the SharePoint 2019 OnPremise installation.

I set the "HKLM:\Software\Policies\Microsoft\OneDrive\SharePointOnPremFrontDoorUrl" key to the SharePoint URL, and also "HKLM:\Software\Policies\Microsoft\OneDrive\SharePointOnPremPrioritization" to 1 .

After this. when I start OneDrive, I get prompted for a username&password, in a dialog box which looks like the ADFS login of my on-premise Sharepoint (this makes be believe there is connectiviy at least to the ADFS controller.
However, after I enter the username & password, I get the message "There was a problem connecting to OneDrive" with Error Code: 0x8004de40.

Anybody knows hot to fix this ?

Thank you.

OneDrive Management
OneDrive Management
OneDrive: A Microsoft file hosting and synchronization service.Management: The act or process of organizing, handling, directing or controlling something.
1,167 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,864 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Trevor Seward 11,691 Reputation points
    2021-02-16T15:48:54.707+00:00

    Only NTLM (and technically Kerberos for Windows clients only) is supported as an authentication mechanism for OneDrive sync client when working with SharePoint Server.

    Since you're hitting the AD FS prompt, this will fail as expected.

    0 comments No comments

  2. Echo Du_MSFT 17,121 Reputation points
    2021-02-17T03:02:49.583+00:00

    Hello @Serban-2306 ,

    OneDrive sync client only supports Windows Authentication (NTLM or Kerberos).

    Since you have ADFS, use a non-claims relying party on ADFS for SharePoint. This will allow you to use Windows authentication (Kerberos Constrained Delegation) instead.

    68896-onedrive.png

    Thanks,
    Echo Du

    ======================
    Updated Answer ==========================
    Hi @Serban-2306 ,

    This error can occur due to several reasons including incorrect Internet configuration and corrupted OneDrive installation.

    Please try the following troubleshooting:

    1.Change Internet Properties

    a) On the Search icon bar, type inetcpl.cpl and click it to open the Internet Properties window.
    b) On the Internet Properties window, open the Advanced tab.
    c) Under Settings, scroll down and find the following options and check their boxes:

    • Use TLS 1.0
    • Use TLS 1.1
    • Use TLS 1.2

    d) Click Apply and OK to save the changes.

    69189-1.png

    2.Configure internet proxy settings

    a) On the Internet Properties window, open the Connection tab.
    b) Click on LAN Settings.

    69170-2.png

    c) Under LAN Settings, uncheck “Use a proxy server for your LAN” option. Next, check the “Automatically detect settings” option.
    d)Click Apply and OK to save the changes.

    69321-3.png

    3.Reinstall OneDrive Client

    4.Reset Winsock properties

    a) Run Command Prompt(cmd) as an Administrator.
    b) Type the following command hit Enter:

    • Netsh winsock reset catalog

    69263-4.png

    c) Once the command is successfully executed, close the command prompt and restart your PC.

    Thanks,
    Echo Du

    =====================

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. Serban 16 Reputation points
    2021-02-17T17:37:10.163+00:00

    Hi @Trevor Seward , @Echo Du_MSFT

    I changed the configuration in the SharePoint, switched to NTLM Authentication.
    I included my machine in the same local domain, I'm logged in in SP with the use who has needed rights, everything seems to be consistent.
    Yet I run into the same error

    For context, let me offer some more info, in case somebody has an idea, since I'm actually stuck in this and I have no other option....

    what works fine
    I login to windows with the DOMAIN\username credentials.
    I access SharePoint (also with DOMAIN\username credentials) at URL: https://our-sp2019.DOMAIN.local (ex: the "All Documents" section is accesible at https://our-sp2019.DOMAIN.local/Shared%20Documents/Forms/AllItems.aspx )
    I access OneDrive at ULR: https://our-sp2019.DOMAIN.local/my/personal/onedrive/username (and then get redirected to https://our-sp2019.DOMAIN.local/my/personal/onedrive/username/\_layouts/15/onedrive.aspx

    ***where it stops to work****
    In my Files section in OneDrive, I click "Sync"; OneDrive desktop app is launched, "DOMAIN\username" is pre-filled, I get to the prompt where I enter the password, and after that I get the same error: "There was a problem connecting to OneDrive" with Error Code: 0x8004de40 .

    I inspected it with fiddler, and this is I found, after I type the password:
    GET https://our-sp2019.DOMAIN.local/my/personal/onedrive/username/\_layouts/15/onedrive.aspx

    with response
    403 Forbidden
    ...
    X-MSDAVEXT_Error: 917656; Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.

    In regedit un HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\OneDrive I tried setting SharePointOnPremFrontDoorUrl to various values, none of them worked:

    Any help, ideas, would help a lot.

    Thank you.


  4. Serban 16 Reputation points
    2021-02-18T08:35:21.407+00:00

    Hi again @Trevor Seward and @Echo Du_MSFT :)

    This morning I was able to solve the issue: what I did was configure the SharePoint web application to allow *only NTLM-based authentication****.
    When I wrote my previous message, it was allowing **both
    NTLM & ADFS, and the first thing the WebUI was showing was a prompt to choose between the NTLM and the ADFS Controller, and only after that you were actually being prompted for the user&pass.
    I guess the OneDrive client could not handle this.

    So, bottom-line conclusion: OneDrive Sync Client only works with NTLM Authentication for now, right ?

    Anybody knows if Microsoft has any plans for making it work with ADFS as well in the near future ?

    Thanks.


  5. Bart Plessers 0 Reputation points
    2023-01-27T10:01:56.8533333+00:00

    Hi,

    I had same problem too.

    However, this was due to the fact that my portal ([https://our-sp2019.DOMAIN.local) had anonymous access configure.

    So following settings seems to work for me

    SERVER

    • SharePoint 2019
    • Windows Authentication (NTLM/Kerberos + basis authentication)
    • portal site MUST be authenticated

    CLIENT

    • registry settings:
      [https://learn.microsoft.com/en-us/sharepoint/install/configure-syncing-with-the-onedrive-sync-app
    0 comments No comments