Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create new user in sonar

Tags:

sonarqube

Is it possible to create a new user in sonar without using the web interface? I need to write a script that inserts the same users for some tools, including sonar.

like image 941
Madalina Avatar asked Aug 25 '10 15:08

Madalina


People also ask

What is the default user group for sonar?

When installing SonarQube, a default user with Administer System permission is created automatically: Login: admin. Password: admin.

How do I find my SonarQube username and password?

Sonar, by default, creates an Administrator account with username admin and password admin . Point your browser at http://localhost:9000/ . At the top right of the dashboard, click on the Log in link and fill in the form with username as admin and password as admin .


2 Answers

There are three ways you can do this:

  1. Write directly to the database (there is a simple table called users).

  2. Use the LDAP plugin, if you specify sonar.authenticator.createUsers: true in sonar.properties, it will create the users in the sonar database automatically the first time they authenticate.

  3. Write a java application that depends on the sonar plugin API, you can then use constructor injection to get a Sonar hibernate session and persist the user you want. See Here.

like image 90
shipmaster Avatar answered Oct 02 '22 14:10

shipmaster


Since SonarQube version 3.6, there is support for user management in webservice API: https://sonarqube.com/web_api/api/users

http://docs.sonarqube.org/display/DEV/Web+API

like image 40
Leandro Conca Avatar answered Oct 02 '22 14:10

Leandro Conca