Failure to connect to SonarCube instance from SonarLint due to OKTA

660 views
Skip to first unread message

stathis...@gmail.com

unread,
Aug 23, 2017, 11:08:36 AM8/23/17
to SonarLint
Hi,

I am trying to connect to a SonarCube instance but I am getting the error 

INFO - ellij.tasks.ConnectionTestTask - Connection test failed
java.lang.IllegalStateException: Unable to parse server infos from: <!DOCTYPE html>
<!--[if IE 7]><html class="lt-ie10 lt-ie9 lt-ie8"><![endif]-->
<!--[if IE 8]><htm...


I was puzzled, since the only thing SonarLint code is trying to do it a simple 

GET /api/system/status

which when I use my Chrome browser returns a Json payload.

  • ...
    version
    : "6.4.0.25310",
  • status: "UP"



So I did a curl request and boom (I am stripping company names etc)


!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>303 See Other</title>
</head><body>
<h1>See Other</h1>
<p>The answer to your request is located <a href="https://sonar/login?ReturnTo=https%3A%2F%2Fsonar%2F&amp;IdP=http%3A%2F%2Fwww.okta.com%2Fexk1778evlylH8os91d8">here</a>.</p>
</body></html>

So apparently due to using Okta authentication SonarLint cannot connect to SonarCube.

Is there any workaround for this?

Thanking in advance :)

Julien HENRY

unread,
Sep 14, 2017, 8:46:08 AM9/14/17
to stathis...@gmail.com, SonarLint
Hi, and sorry for the late reply.

From your provided information, I guess you have developed a custom authentication plugin. In this case, you should use token base authentication in SonarLint.

Login to SonarQube using your web browser (and OKTA), then go to your user settings and generate a token. Then use this token in SonarLint:

++

Julien Henry | SonarSource

Developer

http://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/bdaad84e-b6f3-4c93-a3a2-3bb7bdede8e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

stathis...@gmail.com

unread,
Sep 14, 2017, 9:50:30 AM9/14/17
to SonarLint
Thanks for replying,

I get excactly the same error by using the token authentication.(I am getting a redirection to the OKTA login page.)
Seems like it's OKTA needs some cookie to let you through? 
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

Julien HENRY

unread,
Sep 14, 2017, 9:57:28 AM9/14/17
to stathis...@gmail.com, SonarLint
How is your OKTA authentication implemented? Using a custom SonarQube plugin, or by having a proxy in front of SonarQube?

Julien Henry | SonarSource

Developer

http://sonarsource.com


To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/89a2fabd-9ceb-4b98-a64e-4e5b23b7e34b%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages