- GoCD server version v17.5.0 or above
- GitHub oauth application's
ClientId
andClientSectret
- GitHub
personal access token
to access private organizations and teams
Copy the file build/libs/github-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.
- Login into your GitHub account
- Navigate to Developer applications
- Click Register a new application.
- In "Application name", type the name of your app.
- In "Authorization callback URL", type
https://your.goserver.url/go/plugin/cd.go.authorization.github/authenticate
- Click Register application.
- Note down the
Client ID
andClient Secret
of your application.
-
Verify your email address, if it hasn't been verified yet.
-
Navigate to Personal access tokens.
-
Click Generate new token.
-
Give a name to your token.
-
In scope, select following values:
read:org
to read org and team membershipread:user
to read all user profile datauser:email
to access user email addresses (read-only)
-
Click Generate token.
-
Copy the generated token and save it.
Note: After you navigate off the page, the token will not be visible due to security reasons.
- Login to
GoCD server
as admin and navigate to Admin > Security > Authorization Configuration - Click on Add to create new authorization configuration
- Specify
id
for auth config - Select
GitHub authorization plugin for GoCD
for Plugin id - Choose
GitHub
orGitHub Enterprise
forAuthenticate with
. - Specify Client ID and Client Secret
- Specify Personal access token
- Save your configuration
- Specify
- Login to
GoCD server
as admin and navigate to Admin > Security > Role Configuration - Click on Add to create new role configuration
- Specify
name
for your role - Select
Auth Config Id
of previously created authorization configuration - Specify
GitHub organization's
name for GitHub organizations- If user is a member of at least one organization specified here, then plugin will assign this role to user
- Must be provided as comma-separated values
- Specify
GitHub Teams
name for GitHub teams- If user is a member of at least one of the organization team, then plugin will assign this role to user
- Must be provided in
OrganizationName: TeamA, TeamB ... TeamN
format
- Specify
username
of GitHub users forGitHub users
- If user's username is listed here, then plugin will assign this role to user
- Must be provided as comma-separated values
- Specify