JIRA Does Not Authenticate with Subversion – Resolved!

jiralogoAn early configuration where JIRA and Subversion were installed on the same server using LDAP for user credentials worked as designed. However, the design of the working environment was modified significantly: New hardware, upgraded applications, and JAVA versions. JIRA would be installed on one server and Subversion on another. In this new configuration, JIRA was no longer able to authenticate with Subversion. Although the resolution to this problem was not readily apparent, the solution is too simple.

To determine the cause of this problem, I created a new development enviroment. One where JIRA would reside on the same server as Subversion without authentication. JIRA was able to communicate with Subversion and on the Administration menu under Subversion Repositories, the Status for that repository was Active. I then attempted JIRA on one server and Subversion on another without authentication. Again, JIRA was able to communicate. The most notible difference between the development and production environments is authentication.

Other factors could be considered and were, however, will not be addressed in this article. There was an error in the JIRA logs.

SVNAuthenticationException: svn: Authentication failed

An Internet search found the following statement that put me a little closer to the solution (source):

The idea is to enforce the mod_auth_sspi to offer Basic Authentication and to challenge Basic Authentication first and NTLM second. By default the mod_auth_sspi challenges NTLM first and does not offer Basic Authentication at all.

A search found a Problem authenticating with subversion repository using Active Directory. Here it was reported that the subversion plugin did not authenticate with the subversion repository even though the credentials were valid. The error was the same. The workaround is to change the order of the authentication methods with the following JVM property:

-Dsvnkit.http.methods=Basic,Digest,Negotiate,NTLM

To apply this change, use a command prompt, go to the JIRA installation \bin folder, then type tomcat6w //ES//JIRA or tomcat7w //ES//JIRA (depending on your verision of JIRA). Click on the Java tab and append the above code to the Java Options: section. Press OK. Restart JIRA. Done.

jira-subversion-fix-01
jira-subversion-fix-02

The result, JIRA and Subversion are able to communicate. Done.