Jenkins Pipeline - waitForQualityGate - Work only when force user authentication disabled

Hello!

I have a intregation Sonarqube - Jenkins. Did a jenkins pipeline that get of status quality gates

 stage("Quality Gate") {
        timeout(time: 5, unit: 'MINUTES') { 
        waitForQualityGate abortPipeline: true
        }    
    } 

It’s work fine, but only when force user authentication disabled

I can’t leave this disabled for security reasons.

When force user authetication is enabled, I got this error

org.sonarqube.ws.client.HttpException: Error 403 on https://10.1.5.25l/api/ce/task?id=AWyQSAI3aMQ40kwwhQkq : {"errors":[{"msg":"Insufficient privileges"}]}

I understand that I need to send the username and password when requesting the API, but how do I do it?

Sonarqube version 6.7.5 - Jenkins 2.176.1

Hi,

You need to include the analysis token in the SonarQube Server configuration at the global level, then use that server config in the analysis. The docs should help.

 
Ann

5 posts were split to a new topic: Trouble setting up Jenkins analysis