Fix a bug that prevents basic authentication working.

This bug was causing a second ? in the url - where there should have been an ampersand.  Occurs, for example, on servers that include a namespace.  Needs to be merged into the current prod portals as well as 1-2-3