Work with automatic login and sonar run

This leverages sonar.forceAuthentication=true to force the users to be
authenticated.  The implementation details have been provided as well.

Support for sonar executions when the URL being requested is localhost
(configurable) has also been implemented.