Properties sonar.login and sonar.password

Hello I am running SonarQube in windows

I got an error while running sonar-scanner:

INFO: Scanner configuration file: C:\Users\gb6325\OneDrive - ENGIE\Documents\sonarqube\scan\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.7.0.2747
INFO: Java 11.0.14.1 Eclipse Adoptium (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\gb6325\.sonar\cache
INFO: Scanner configuration file: C:\Users\gb6325\OneDrive - ENGIE\Documents\sonarqube\scan\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 9.4.0
INFO: Default locale: "fr_FR", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Load global settings
WARN: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@1b7cc17c-org.sonar.scanner.bootstrap.ScannerPluginRepository': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@1b7cc17c-org.sonar.scanner.bootstrap.ScannerPluginInstaller': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@1b7cc17c-org.sonar.scanner.bootstrap.PluginFiles': Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'GlobalConfiguration' defined in org.sonar.scanner.bootstrap.GlobalConfigurationProvider: Unsatisfied dependency expressed through method 'provide' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'GlobalServerSettings' defined in org.sonar.scanner.bootstrap.GlobalServerSettingsProvider: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonar.scanner.bootstrap.GlobalServerSettings]: Factory method 'provide' threw exception; nested exception is Not authorized. Please check the properties sonar.login and sonar.password.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1.400s
INFO: Final Memory: 5M/54M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: Not authorized. Please check the properties sonar.login and sonar.password.
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Where and how I can change sonar.login and sonar.password ?

The documentation on the SonarScanner provides details on configuring analysis paramters.

Hello,
The documentation on the SonarScanner doesn’t refer to sonar.password parameter anymore, does it mean that it will be deprecated shortly?
Do you still advice to use it?
My tests can show that it is still correctly used with sonar.login as credentials, but the doc seems to only promote token usage through sonar.login property.
Could you clarify this point please?
Thx for your feedback.

Hey there.

sonar.password was deprecated in SonarQube v9.8 ([SONAR-4043] - Jira) – passing a token to sonar.login is reccomended.