forked from gocd-contrib/github-oauth-authorization-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Bhupendra edited this page May 23, 2018
·
3 revisions
Welcome to the Github-OAuth-authorization-plugin wiki!
- GoCD server version v17.5.0 or above
- GitHub OAuth application's
ClientIdandClientSectret - GitHub
personal access tokento 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 to 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 IDandClient Secretof 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:orgto read org and team membership -
read:userto read all user profile data -
user:emailto 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.
- Log in to
GoCD serveras admin and navigate to Admin > Security > Authorization Configuration - Click on Add to create new authorization configuration
- Specify
idfor auth config - Select
GitHub authorization plugin for GoCDfor Plugin id - Choose
GitHuborGitHub EnterpriseforAuthenticate with. - Specify Client ID and Client Secret
- Specify Personal access token
- Save your configuration
- Specify
- Log in to
GoCD serveras admin and navigate to Admin > Security > Role Configuration - Click on Add to create new role configuration
- Specify
namefor your role - Select
Auth Config Idof previously created authorization configuration - Specify
GitHub organization'sname for GitHub organizations- If a user is a member of at least one organization specified here, then the plugin will assign this role to the user
- Must be provided as comma-separated values
- Specify
GitHub Teamsname for GitHub teams- If a user is a member of at least one of the organization team, then the plugin will assign this role to the user
- Must be provided in
OrganizationName: TeamA, TeamB ... TeamNformat
- Specify
usernameof GitHub users forGitHub users- If user's username is listed here, then the plugin will assign this role to the user
- Must be provided as comma-separated values
- Specify