Www authenticate fix

This path should fix the case with multiple authentication methods returned by the TS gateway server.

This PR superseed #1799 and #1800.