Troubleshooting SharePoint 2013: Anonymous Users get Credentials Prompt For Default “osssearchresults.aspx” Search Page on SharePoint Publishing Site

SharePoint 2013 farm with several host header site collection. Those site collections are enable to the public also, therefore all anonymous users can view those site collections. Except one site collection anonymous user can access “osssearchresults.aspx” default search page. All site collections are in the same web application. To verify the problem create a separate web part page and insert “Search Box” web part and “Search Result” web part. Still get the same problem new page also prompting the user credentials for anonymous users. Then tried Fiddler to identify what are the pages that are prompting permission. Actually it’s not pages. There are some “JS” files that required user credentials. Reason is those files are not published properly. Then “checked in” all those “JS” files by publishing major version of those files.

*Note: “Control_SearchBox.js and Control_SearchResult.js” are the two main files related to “osssearchresults.aspx” page. Therefore make sure you publish/”check in” the major version of those two files.

Below you can find two directories.you need to “check in”  all unpublished “JS” files in these two directories.using SharePoint designer navigate to these directories and publish/”check in” new version of it’s “JS” files. SharePoint use these “JS” files in “Search Box” and “Search Result” Web Parts. If these files are not publish/”check in” properly that means anonymous users cannot access these files. That’s why “Search Box” and “Search Result” web parts are prompting for credentials.

 

“Catelogs/masterpages/display template/search”

https://hpksanje.files.wordpress.com/2014/04/searchbox_thumb.png?w=1028&h=118

“Catelogs/masterpages/display template/finters “

https://hpksanje.files.wordpress.com/2014/04/searchbox_thumb1.png?w=1028&h=300

If the problem still exists use “Fiddler” to identify remaining files which are still prompting for credentials. You can download Fiddler using this link.  Hope this helps you.