Failing to connect to SonarQube server from Visual Studio 2019: Invalid credentials

I want to connect Visual Studio Professional 2019 (v16.6.3) to my enterprise’s SonarQube server via the SonarLint plugin for Visual Studio (v4.23.0.19399).

In the “Connect to a SonarQube Server” modal dialog I enter these values:

SonarQube server: https://my.company.server.com/sonarqube/
Username/Token: <name of token I created at https://my.company.server.com/sonarqube/account/security/>
Password: <token_value>

but when I click on Connect it fails with:

Cannot connect to the SonarQube server. Make sure you provided the correct connection information, including your sign-in credentials, and try again.
See more information in the output window (SonarLint).

SonarLint output window:

Connecting to SonarQube server: https://my.company.server.com/sonarqube/
Connecting to SonarQube server: Validating credentials
Connecting to ‘https://my.company.server.com/sonarqube/’.
Connected to SonarQube ‘7.9.1.27448’.
SonarQube request failed: Invalid credentials
Connecting to SonarQube server: Failed
Disconnecting…

Can someone help me connect please? I’ve tried creating different tokens but to no avail. I had no problem connecting to the same server from PyCharm using a different token, but using PyCharm’s token in Visual Studio gives me the same error as above.

Hi @cacti77, welcome to the community :wave:

Try to input the token value in the “username/token” field, and keep the “password” field empty. That should do the trick. You can read about it in our documentation.

Thanks @rita.g - that worked! That’s the first time I’ve seen those docs. Can I suggest you put a direct link to those docs from Linter IDE Tool & Real-Time Software for Code | Sonar ? Not to mention the Connect dialog itself could be made more intuitive:).

I’ve linked to my project but now I get a stacktrace every time I try to analyse a C++ file. It starts with this:

Failed to analyze C:\path\to\MyFile.cpp, exception details: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.InvalidOperationException: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.

I start a separate topic thread on this if you want…?

I’m glad to hear that it worked!
Thanks for the feedback, we agree and it’s on our roadmap to address these issues. Feel free to watch the issue of binding experience improvement, and we hope we can make our documentation easier to find in the near future.

And yes, please open a separate thread for the analysis issue :slight_smile:

Thanks for telling me about that issue. I’ve just raised a separate issue re the exception here.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.