Uploaded image for project: 'SonarQube Eclipse'
  1. SonarQube Eclipse
  2. SONARCLIPS-273

Don't ask credentials to browse Sonar server in Web View

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 3.0
    • Component/s: Web View
    • Labels:
      None

      Description

      Sonar Eclipse should provide credentials for Sonar Server under the hood in order to not bother users by showing login dialog. Currently this dialog appears for a new session and when session expires (can be easily tested by setting "Force user authentication" to "true" in Sonar Server).

      For implementation of this feature take a look on org.eclipse.swt.browser.Browser#addAuthenticationListener(AuthenticationListener listener)

        Issue Links

          Activity

          Hide
          godin OLD - Evgeny Mandrikov added a comment -

          AuthenticationListener would not work, because Sonar does not return 401 HTTP Unauthorized, but instead provides Login page.
          However, if request contains Authorization header, then login will be performed automatically. This header can be passed as following:

          browser.setUrl("...", null, new String[] {"Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ="}); // Base64 encoding of username:password
          

          But this method available since 3.6.

          Show
          godin OLD - Evgeny Mandrikov added a comment - AuthenticationListener would not work, because Sonar does not return 401 HTTP Unauthorized, but instead provides Login page. However, if request contains Authorization header, then login will be performed automatically. This header can be passed as following: browser.setUrl( "..." , null , new String [] { "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=" }); // Base64 encoding of username:password But this method available since 3.6.
          Hide
          godin OLD - Evgeny Mandrikov added a comment -

          As was decided with Freddy : this ticket is postponed.

          Show
          godin OLD - Evgeny Mandrikov added a comment - As was decided with Freddy : this ticket is postponed.
          Hide
          henryju OLD - Julien HENRY added a comment -

          As mentioned by Evgeny the fix raises requirement on Eclipse 3.6 (Helios). There was also the action "open in Sonar server" that was opening an internal Eclipse browser. I changed that to instead open the web view as it was not possible to pass credentials to the internal browser.

          Show
          henryju OLD - Julien HENRY added a comment - As mentioned by Evgeny the fix raises requirement on Eclipse 3.6 (Helios). There was also the action "open in Sonar server" that was opening an internal Eclipse browser. I changed that to instead open the web view as it was not possible to pass credentials to the internal browser.
          Hide
          freddy.mallet Freddy Mallet added a comment -

          Well done Julien !

          Show
          freddy.mallet Freddy Mallet added a comment - Well done Julien !

            People

            • Assignee:
              henryju OLD - Julien HENRY
              Reporter:
              godin OLD - Evgeny Mandrikov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: