netlify oauth github client sending token in form as netlify service itself
Branch: master
Clone or download
Latest commit 1265bbc Aug 24, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore auth window target env var added Aug 23, 2018
index.js auth window target env var added Aug 23, 2018
package.json engines (node >7 req bcause of es6) Jul 14, 2017


External authentication providers were enabled in netlify-cms version 0.4.3. Check your web console to see your netlify-cms version.

netlify-cms has its own github OAuth client. This implementation was created by reverse engineering the results of that client, so it's not necessary to reimplement client part of netlify-cms.

Github, Github Enterprise and Gitlab are currently supported, but as this is a general Oauth client, feel free to submit a PR to add other git hosting providers.

Other implementations in: Go lang.

1) Install Locally

Install Repo Locally

git clone
cd netlify-cms-github-oauth-provider
npm install

Create Oauth App Information is available on the Github Developer Documentation or Gitlab Docs. Fill out the fields however you like, except for authorization callback URL. This is where Github or Gitlab will send your callback after a user has authenticated, and should be for use with this repo.

2) Config

Auth Provider Config

Configuration is done with environment variables, which can be supplied as command line arguments, added in your app hosting interface, or loaded from a .env (dotenv) file.

Example .env file:


For Gitlab you also have to provide this environment variables:


You can also setup an environment variable to configure "_blank" target when auth window is opened. Default is "_self".


Client ID & Client Secret: After registering your Oauth app, you will be able to get your client id and client secret on the next page.

Redirect URL (optional in github, mandatory in gitlab): Include this if you need your callback to be different from what is supplied in your Oauth app configuration.

Git Hostname (Default This is only necessary for use with Github Enterprise or Gitlab.

CMS Config

You also need to add base_url to the backend section of your netlify-cms's config file. base_url is the live URL of this repo with no trailing slashes.

  name: [github | gitlab]
  repo: user/repo   # Path to your Github/Gitlab repository
  branch: master    # Branch to update
  base_url: # Path to ext auth provider

3) Push

Basic instructions for pushing to heroku are available in the original blog post.