Skip to content

Latest commit

 

History

History
97 lines (66 loc) · 3.82 KB

INSTALL.md

File metadata and controls

97 lines (66 loc) · 3.82 KB

GitLab OAuth authorization plugin for GoCD

Requirements

  • GoCD server version v23.2.0 or above
  • GitLab OAuth application's ApplicationId and ClientSecret

Installation

Copy the file build/libs/gitlab-authorization-plugin-VERSION.jar to the GoCD server under ${GO_SERVER_DIR}/plugins/external and restart the server. The GO_SERVER_DIR is usually /var/lib/go-server on Linux and C:\Program Files\Go Server on Windows.

Configuration

Check GoCD server site urls

  1. Login to GoCD server as admin and navigate to Admin > Server Configuration > Server Configuration
  2. Check both server site urls for HTTP and HTTPS. If one of these fields is empty, it could lead to HTTP 500 error on GitLab OAuth login.

Create GitLab OAuth application

  1. Login into your GitLab/GitLab Enterprise account

  2. Navigate to Settings/Preferences "GitLab settings"

  3. Click on Applications. "GitLab applications"

  4. Fill the following details for application

    • Give a name to your application
    • In Redirect URI, specify https://your.goserver.url/go/plugin/cd.go.authorization.gitlab/authenticate.
    • Ensure Confidential is selected.
    • In scopes, select read_user (versions of this plugin before 2.2 required api scope. This is now configurable and read_user is less permissive, thus recommended.)

    "Fill application details"

  5. Click Save application.

    "Save application"

  6. Note down the Application ID and Secret of your application.

    "GitLab application info"

Create Personal Access Token

A Gitlab Access Token is only needed when wanting to use either of these two functionalities:

  • Allow users to generate/issue GoCD Personal Access Tokens
  • Use GoCD role configuration for authorization (mapping GitLab groups to GoCD roles/permissions)

If you want to use Gitlab only for login, and without GoCD Personal Access Token support, a GitLab Access Token is not required.

  1. Login into your GitLab/GitLab Enterprise account

  2. Navigate to Settings/Preferences

    "GitLab settings"

  3. Click on Access Tokens

    "GitLab access tokens"

  4. Fill the following details for access token

    • Give a name to your token
    • In scopes
      • select read_user if you only want to support GocD Personal Access Tokens.
      • select read_api if you also intend to configure authorizations/GoCD role mappings from Gitlab -> GoCD.

    "Fill access token detail"

  5. Note down the Token Value.

    GitLab personal access token info

Create Authorization Configuration

  1. Login to GoCD server as admin and navigate to Admin > Security > Authorization Configuration

  2. Click on Add to create new authorization configuration

    1. Specify id for auth config
    2. Select GitLab OAuth authorization plugin for Plugin id
    3. Choose GitLab or GitLab Enterprise for Authenticate with.
    4. Specify Application ID, Client Secret and validate the Client Scopes Requested match your GitLab Application.
    5. Specify Personal Access Token Value if necessary (see tooltip).
    6. Save your configuration

    Create authorization configuration