Wednesday 22 July 2009

Anonymous Access SharePoint WCM Site prompting for login in IE only.

Watch out for those SharePoint anonymous access demons, while a new site that I have been working on was going through testing on its way to UAT we encountered an odd bug where only IE 6-8 would request a login box when loading some pages, we traced this down to one Custom control that was pulling an item from a SharePoint list and displaying some images with their description.

As this was not an issue in other browsers we concluded that it was not the control or a case that the images were not published (though we checked to be sure), after a long night and a few tufts of hair lost to frustration I had a look at the html output, there plain as day was the culprit, an image tag with no alt or source, I have come across this before and could kick myself for it but what happened was the developer simply fetched the value of the image field and rendered the html supplied by SharePoint. When no image Url is supplied SharePoint outputs a blank image tag like this <img src=”” alt=””></img>, this tag causes IE to try and authenticate the user(don’t know why never botherd to look any deeper).

So the lesson learnt Don’t trust SharePoint’s Html it can be a Demond in disguise.

No comments: