Github Authentication in Sonar Fails with Proxy

121 views
Skip to first unread message

Christi...@icloud.com

unread,
Feb 15, 2017, 7:18:33 AM2/15/17
to SonarQube
Hi Sonar team,

It looks like I found a bug in the GitHub Authentication App (V1.3).

I have a running SonarQube (V6.1 configured with an Apache reverse proxy for using HTTPS) with the GitHub Authentication App installed. Every configuration has been made and doublechecked. I want to authenticate against our corporate Github but when I click on the button it returns me an "Unauthorized". 

Digging into the sonar.log I saw that there seems to be a problem with using Proxies. I checked if the proxy settings are correct and I can confirm that.

The log message states the following:
2017.02.15 09:53:57 ERROR web[][o.s.s.a.AuthenticationError] Fail to callback authentication with 'github'
com
.github.scribejava.core.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service: https://<Company-Github>/login/oauth/access_token
        at com
.github.scribejava.core.model.OAuthRequest.send(OAuthRequest.java:39) ~[na:na]
        at com
.github.scribejava.core.oauth.OAuth20Service.sendAccessTokenRequestSync(OAuth20Service.java:37) ~[na:na]
        at com
.github.scribejava.core.oauth.OAuth20Service.getAccessToken(OAuth20Service.java:56) ~[na:na]
        at org
.sonarsource.auth.github.GitHubIdentityProvider.onCallback(GitHubIdentityProvider.java:119) ~[na:na]
        at org
.sonarsource.auth.github.GitHubIdentityProvider.callback(GitHubIdentityProvider.java:107) ~[na:na]
        at org
.sonar.server.authentication.OAuth2CallbackFilter.doFilter(OAuth2CallbackFilter.java:71) ~[sonar-server-6.1.jar:na]
        at org
.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:126) [sonar-server-6.1.jar:na]
        at org
.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:95) [sonar-server-6.1.jar:na]
        at org
.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:60) [sonar-server-6.1.jar:na]
        at org
.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.sonar.server.platform.web.RoutesFilter.doFilter(RoutesFilter.java:55) [sonar-server-6.1.jar:na]
        at org
.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:113) [sonar-server-6.1.jar:na]
        at org
.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:81) [sonar-server-6.1.jar:na]
        at org
.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at ch
.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:191) [logback-access-1.1.3.jar:na]
        at org
.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at org
.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at java
.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_111]
        at java
.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_111]
        at org
.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.32.jar:8.0.32]
        at java
.lang.Thread.run(Unknown Source) [na:1.8.0_111]
Caused by: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 503 Service Unavailable"
        at sun
.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source) ~[na:1.8.0_111]
        at sun
.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source) ~[na:1.8.0_111]
        at sun
.net.www.protocol.http.HttpURLConnection.getOutputStream0(Unknown Source) ~[na:1.8.0_111]
        at sun
.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source) ~[na:1.8.0_111]
        at sun
.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source) ~[na:1.8.0_111]
        at com
.github.scribejava.core.model.OAuthRequest.addBody(OAuthRequest.java:86) ~[na:na]
        at com
.github.scribejava.core.model.OAuthRequest.doSend(OAuthRequest.java:55) ~[na:na]
        at com
.github.scribejava.core.model.OAuthRequest.send(OAuthRequest.java:37) ~[na:na]
        
... 34 common frames omitted


Any ideas what this has been caused?

Thanks a lot in advance!
Reply all
Reply to author
Forward
0 new messages