Index: archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java =================================================================== --- archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java (revision 649448) +++ archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java (working copy) @@ -77,12 +77,11 @@ // Authentication Tests. try { - AuthenticationResult result = httpAuth.getAuthenticationResult(request, null); + AuthenticationResult result = httpAuth.getAuthenticationResult( request, null ); - if ( result == null || !result.isAuthenticated() ) + if ( result != null && !result.isAuthenticated() ) { - //Unfortunatly, the DavSessionProvider does not pass in the response - httpAuth.authenticate(request, null); + throw new UnauthorizedDavException(repositoryId, "User Credentials Invalid"); } } catch ( AuthenticationException e ) @@ -130,7 +129,7 @@ ",permission=" + permission + ",repo=" + repositoryId + "] : " + authzResult.getException().getMessage() ); } - throw new DavException(HttpServletResponse.SC_UNAUTHORIZED, "Access denied for repository " + repositoryId); + throw new UnauthorizedDavException(repositoryId, "Access denied for repository " + repositoryId); } } catch ( AuthorizationException e ) Index: archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java =================================================================== --- archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java (revision 649448) +++ archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/RepositoryServlet.java (working copy) @@ -121,7 +121,9 @@ } catch (DavException e) { if (e.getErrorCode() == HttpServletResponse.SC_UNAUTHORIZED) { - log.error("Should throw UnauthorizedDavException"); + final String msg = "Should throw " + UnauthorizedDavException.class.getName(); + log.error(msg); + webdavResponse.sendError(e.getErrorCode(), msg); } else { webdavResponse.sendError(e); }