Skip to content

sharpred/gocd-oauth-login

 
 

Repository files navigation

GoCD OAuth Login Build Status

This is GoCD's Authentication plugin that allows users to login using OAuth.

Currently supported

  • GitHub
  • Google
  • GitLab (CE)

Adding new providers

The plugin internally uses social-auth which acts as a wrapper for multiple OAuth integrations. Hence adding more integrations is very little effort. You will need to add a provider and a maven profile (use Google implementation for reference).

Requirements

  • GoCD >= v15.2

Getting Started

Installation

Download the latest plugin jar from Releases section. Place it in <go-server-location>/plugins/external and restart Go Server.

Configuration

Create an OAuth Application with an OAuth provider of your choice (GitHub, Google, etc.)

The oauth provider will normally ask you for an "OAuth Redirect URL". The redirect URL for the two plugins will be —

  • Github OAuth Plugin -- https://your-go-server/go/plugin/interact/github.oauth.login/authenticate
  • Google OAuth Plugin -- https://your-go-server/go/plugin/interact/google.oauth.login/authenticate
  • GitLab OAuth Plugin -- https://your-go-server/go/plugin/interact/gitlab.oauth.login/authenticate

Note: We highly recommend that you use HTTPS for OAuth authorizations.

Once your application is registered, you will receive an "OAuth Client ID" and "OAuth Client Secret", save those for the next step.

Configure the GoCD Server

Note: Due to a bug in the current version of GoCD, you'll need to set a valid Password file path under Server Configuration (or configure an LDAP server).

It is also recommended you have at least one local admin configured to avoid getting yourself locked out during this process. If you're using password files, make sure the file contains at least one entry.

On your go server, visit the plugin settings page, and enter those credentials.

On clicking save, you may be be logged out, if you're not logged out. Now is a good time to logout and see if you can get in.

The GitHub and GitLab plugins also supports user search, allowing you to search and add users right from GoCD's UI: Add User

Contributing

We encourage you to contribute to Go. For information on contributing to this project, please see our contributor's guide. A lot of useful information like links to user documentation, design documentation, mailing lists etc. can be found in the resources section.

License

Copyright 2015 ThoughtWorks, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Packages

No packages published

Languages

  • Java 90.2%
  • HTML 9.8%