Tool authorization credentials are invalid error for SonarQube in DevOps Change VelocityIssue The SonarQube tool connection in DevOps Change Velocity (DCV) fails with the error Tool authorization credentials are invalid. Enter valid credentials, and try again. The failure occurs when you create or test the connection using a user name and account password. The connection fails and the associated credential and connection records are deleted automatically. Symptoms Creating a tool connection to SonarQube using a MID Server fails with the following error:Tool authorization credentials are invalid. Enter valid credentials, and try again.On the DevOps Tool record, the Connection and credential template and Connection alias fields are empty after a failed connection attempt.The credential and HTTP connection records created during the connection attempt are deleted shortly after creation.A direct request to the SonarQube api/authentication/validate endpoint with the same credentials returns {"valid":false} from the ServiceNow instance, even though the same credentials authenticate successfully when tested directly against SonarQube (for example, with curl or Postman). Facts Affected integration: DevOps Change Velocity (DCV) tool connection to SonarQubeAuthentication method: HTTP Basic Authentication, where SonarQube expects a user-generated token as the credential, not a username and passwordConnection can be configured directly or through a MID ServerTrigger condition: a SonarQube account username and password are entered in the Password or access token field instead of a token generated in SonarQube Release Any release of DevOps Change Velocity plugin Cause This behavior is by design. DevOps Change Velocity (DCV) authenticates to SonarQube using a user access token only. The token is passed as the login value in HTTP Basic Authentication with an empty password: DCV adds a colon after the token, base64-encodes the result, and sends it in the Authorization: Basic header. When you enter a user name and an actual account password in the Password or access token field, SonarQube does not recognize the value as a token. The authentication validation call returns an invalid result. The automated subflow that cleans up invalid connections then deletes the credential and HTTP connection records. This is why the Connection and credential template and Connection alias fields are empty on the DevOps Tool record afterward. You may expect standard user name and password basic authentication to work, because SonarQube accepts that method outside of this integration. A connection record created manually with basic authentication, or one where the password value happened to match a token, may have appeared to work previously. The DCV playbook also displays Password or access token in the UI, which can cause confusion. Resolution Please follow below steps. In SonarQube, generate a user access token for the account that connects to the ServiceNow instance.In the ServiceNow instance, open DevOps Change Workspace: go to https://<instance-name>/now/devops-change/home.Click Tools, then open or create the tool connection for SonarQube.In the tool connection form, locate the Password or access token field.Enter the token generated in step 1 in the Password or access token field. Do not enter the SonarQube account password in this field. DevOps Change Velocity (DCV) does not support username/password basic authentication for SonarQube connections, even though SonarQube itself accepts it outside this integration.If you use a MID Server for the connection, select the MID Server option and enter its details.Select Connect to validate the tool connection. Related Links Onboard SonarQube to DevOps Change Velocity