From 2aeb5a17b1ee4d22036491da1052a4e0b3c88874 Mon Sep 17 00:00:00 2001 From: Andreas Nilsson Date: Fri, 20 Mar 2015 10:43:56 -0400 Subject: [PATCH] SERVER-17669 Remove web auth prompt for non-auth mongod --- src/mongo/db/dbwebserver.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mongo/db/dbwebserver.cpp b/src/mongo/db/dbwebserver.cpp index 7b81a0a7ca2..a5489097534 100644 --- a/src/mongo/db/dbwebserver.cpp +++ b/src/mongo/db/dbwebserver.cpp @@ -110,6 +110,10 @@ namespace mongo { vector& headers, const SockAddr &from) { + if ( !cc().getAuthorizationSession()->getAuthorizationManager().isAuthEnabled() ) { + return true; + } + if ( from.isLocalHost() && !_webUsers->haveAdminUsers(txn) ) { cc().getAuthorizationSession()->grantInternalAuthorization(); return true;