Add the isAuthenticated to the UrlBuilder format method, to reduce code
duplication.
Make the authenticated state in MockEndpoint configurable.