How can I enable force authentication in sonarqube instance using api


(Yash Brahmani) #1

Hello Team,
I want to enable the force authentication via Ansible script. Can u tell me how can I set the sonar.forceauthentication=true
I need to run the Ansible on more then 60 instances.

I tried the following but it doesn’t enable the force userauthentication.

Url: “{{sonar_url}}/api/settings/set”
method: POST
body: “key=sonar.forceAuthnetication&value=true”
force_basic_auth: yes
user: admin
password: admin
validate_certs: no

Can you tell me how can I pass the authorization header in this case?its telling me unauthorized error for this task
Sonarversion 6.7.3 is being used by us


(Julien Lancelot) #2

Hi Yash,

I’ve no idea how is working Ansible, the only thing I can tell you is that the correct setting is “sonar.forceAuthentication” and not sonar.forceAuthnetication.

Julien Lancelot

(Julien Lancelot) #3

7 posts were split to a new topic: How can I remove the see source code and browse permission for sonar-users?