When user attempts to connect to VisualSVN Server with a Subversion client, she may receive the following error message:

svn: OPTIONS of 'https://server.domain.local/svn/repo': authorization failed: Could not authenticate to server: could not parse challenge (https://server.domain.local)

The error message in Subversion client is accompanied by the following error event in VisualSVN Server log:

SSPI Challenge failed: The token supplied to the function is invalid

In most cases you may experience the issue if both the following conditions are met:

  • VisualSVN Server service is configured to run under a dedicated user account.
  • Integrated Windows Authentication is enabled.

Note The behavior will be different if you have Basic authentication and Integrated Windows Authentication both enabled in your VisualSVN Server. The error event mentioned above will be recorded to the VisualSVN Server log and user will be authenticated via Basic authentication method. Depending on particular situation, user will be prompted for username and password or she will be authenticated using credentials that are already cached locally on the client machine.

Technical background

The problem occurs when user authenticates against VisualSVN Server over the Negotiate (SPNEGO) authentication protocol and VisualSVN Server service account doesn't have correctly configured Service Principal Name (SPN). You are required to configure SPN manually if you run VisualSVN Server service under a dedicated user account. For further details about SPNs please consider the Service Principal Names Microsoft TechNet article.

You do not have to configure SPN manually if you run VisualSVN Server service under the built-in Network Service user account (it is a default settings). Network Service account acts as the computer on the network and uses the SPN value that is pre-configured for each computer joined to the domain.


Since you run VisualSVN Server service under a dedicated user account, you have to add SPN manually to Active Directory:

  1. Logon to a Domain Controller as a domain administrator or as a user with specific delegated permissions required to modify SPNs. For additional information on permissions required to modify SPNs please read the Setspn Command-Line Reference on Microsoft TechNet.
  2. Start elevated command prompt and enter the following command:
    setspn -a http/ CONTOSO\username

    Please note that you have to modify the command according to your configuration. For additional information on setspn command please refer to the Setspn Command-Line Reference on Microsoft TechNet.

These steps will add SPN for the dedicated user account and you could successfully authenticate to VisualSVN Server over Negotiate.

See also

KB24: Configuring VisualSVN Server service to run under a dedicated user account
KB43: How to configure Integrated Windows Authentication in VisualSVN Server

Last Modified: