/sonar-auth-gitlab-plugin

Use GitLab OAuth login in SonarQube login page

Primary LanguageJavaGNU Lesser General Public License v3.0LGPL-3.0

Sonar Auth GitLab Plugin

https://travis-ci.org/gabrie-allaigre/sonar-auth-gitlab-plugin

Forked from https://github.com/SonarSource/sonar-auth-github

Goal

Enables user authentication and Single Sign-On via GitLab.

Uses GitLab OAuth login in SonarQube login page.

Signin

Usage

For SonarQube >=5.6:

For SonarQube >=5.4:

Other Plugin: Add Reporting in GitLab commit

Configuration

Warning : In SonarQube, must have Server base URL with HTTPS

  • In GitLab, create Application OAuth : Admin Settings -> Application

Fill name SonarQube and fill redirect URI with 'https://mysonar.com/oauth2/callback/gitlab' (replace url) and check read_user

Gitlab Add

Copy Application Id and Secret in Settings of Sonarqube.

Gitlab App

  • In SonarQube: Administration -> General Settings -> GitLab -> Authentication

Sonar Settings

Variable Comment Type
sonar.auth.gitlab.enabled Enable GitLab users to login. Value is ignored if client ID and secret are not defined
sonar.auth.gitlab.url URL to access GitLab
sonar.auth.gitlab.applicationId Application ID provided by GitLab when registering the application
sonar.auth.gitlab.secret Token of the user who can make reports on the project, either global or per project
sonar.auth.gitlab.allowUsersToSignUp Allow new users to authenticate. When set to 'false', only existing users will be able to authenticate to the server

Sonarqube

https://sonarqube.com/dashboard?id=com.talanlabs%3Asonar-auth-gitlab-plugin