SonarQube Eclipse
  1. SonarQube Eclipse
  2. SONARIDE-273

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

    Details

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

      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
          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
          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
          Evgeny Mandrikov added a comment -

          As was decided with Freddy : this ticket is postponed.

          Show
          Evgeny Mandrikov added a comment - As was decided with Freddy : this ticket is postponed.
          Hide
          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
          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 added a comment -

          Well done Julien !

          Show
          Freddy Mallet added a comment - Well done Julien !

            People

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

              Dates

              • Created:
                Updated:
                Resolved: