onarQube Warning - The property 'sonar.login' is deprecated and will be removed in the future

Hi

Recently we upgraded from Sonarqube Enterprise edition 9.3 to Sonarqube Enterprise edition 10.2 after that we are receiving the below warning for NPM code post scan analysis.

“” SonarQube Warning - The property ‘sonar.login’ is deprecated and will be removed in the future. Please use the ‘sonar.token’ property instead when passing a token."

Please help us in resolving the above warning

We have similar issue;
I’ve changed sonar.login to sonar.token in sonar-project.properties file and gave the value which has been generated from SonarQube server with the following steps : MyAccount->Security->Generate Token. (I’ve used Project Analysis Token)

However, I still see below warning message in Sonar Scanner logs even there is no sonar.login property in sonar-project.properties file.

WARN: The property ‘sonar.login’ is deprecated and will be removed in the future. Please use the ‘sonar.token’ property instead when passing a token.

Sonar Server : v10.2
Sonar Scanner : v5.0.1

Hi,

Can I ask you both to take a look at the SonarScanner Context for these analyses? You’ll find them in the Background Tasks row menu.

What parameter was passed in to the scanner? sonar.login or sonar.token?

 
Thx,
Ann

Hi @ganncamp ,

After which version sonar.token will be started to use? We use Sonar 10.2 and the message below is logged on Sonar Scanner.

The property ‘sonar.login’ is deprecated and will be removed in the future. Please use the ‘sonar.token’ property instead when passing a token.

I’ve changed sonar.login to sonar.token in sonar-project.properties file and gave the value which has been generated from SonarQube server with the following steps : MyAccount->Security->Generate Token. (I’ve used Project Analysis Token)

However, I still see warning message in Sonar Scanner logs even there is no sonar.login property in sonar-project.properties file.

Hi @ganncamp ,
thank you for the response.

I’ve checked the SonarScanner Context and both parameters is included in the list, even only sonar.token was passed in sonar-project.properties file,.

There might be something weird :thinking:

1 Like

Do you see any problem with the approach below?

I’ve changed sonar.login to sonar.token in sonar-project.properties file and gave the value which has been generated from SonarQube server with the following steps : MyAccount->Security->Generate Token. (I’ve used Project Analysis Token)

Hi oguzhan,

It would be great if you could open a separate topic, instead of adding your issue into mine. This would cause confusion to both me and the person who helps.

Thanks for Understanding.

2 Likes

Hi Ann,

Thanks for looking into this.

We checked the SonarScanner Context in Sonarqube and it shows both Sonar.login and Sonar.token(Screen shot attached) .

We are using Service connection in Azure Devops and the Service connection is created using Token.(Screen shot

image

Hi,

So you’re both seeing both properties in your contexts. The good news is that you can ignore the deprecation message because you’re covered.

Now the mystery is where the extra property is coming from. @Srisidharth I appreciate the screenshot showing that you’re setting the token value into a spot in the UI labeled ‘Token’. I suspect what’s happening here is that the extension is populating both values for backward compatibility, and this will go away with a future update.

 
HTH,
Ann

Thank you so much for your quick help on this Ann. Have a great weekday ahead :smile: !

1 Like