Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-7396

Strange error when server base URL is badly configured when connecting with an OAuth2 plugin

    XMLWordPrintable

    Details

      Description

      When the server base URL (sonar.core.serverBaseURL) is badly configured, connecting with an auth plugin using OAuth2IdentityProvider (for instance, the GitHub Auth Plugin) fails with :

      2016.02.29 15:31:06 ERROR web[o.s.s.a.AuthenticationError] Fail to callback authentication with /oauth2/callback
      java.lang.IllegalArgumentException: Identity provider /oauth2/callback does not exist or is not enabled
      	at org.sonar.server.authentication.IdentityProviderRepository.getEnabledByKey(IdentityProviderRepository.java:54) ~[sonar-server-5.5-SNAPSHOT.jar:na]
      	at org.sonar.server.authentication.OAuth2CallbackFilter.doFilter(OAuth2CallbackFilter.java:62) ~[sonar-server-5.5-SNAPSHOT.jar:na]
      	at org.sonar.server.platform.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:125) [sonar-server-5.5-SNAPSHOT.jar:na]
      

      This is because the callback url is generated based on the server base URL (see OAuth2ContextFactory.getCallbackUrl()).

      We should find a way to generate a more explicit error message.

        Attachments

          Activity

            People

            Assignee:
            julien.lancelot Julien Lancelot
            Reporter:
            julien.lancelot Julien Lancelot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: