NetlifyCMS GitHub OAuth Provider Server Example
A working example of a custom GitHub OAuth Provider for NetlifyCMS.
This is the server side. The side that handles the GitHub OAuth handshake.
The client side is available on GitHub: https://github.com/tylergaw/netlify-cms-github-oauth-provider-client-example
What You Need to Do
1. Remix this Glitch
You'll need your own copy.
2. Create a GitHub OAuth App
On GitHub, go to Settings > Developer Settings > OAuth apps > New OAuth app. Or use this direct link.
Complete the form using the following values.
Application name: Anything you want to call it. This won't effect functionality.
Homepage URL: This must be the URL to your remix of this Glitch. Go to Show > In a New Window and grab the URL from there. You'll also use this in your NetlifyCMS config.yml
Application description: Anything you want. This won't effect functionality.
Authorization callback URL: This must be the URL to your remix of this Glitch followed by
/callback. If you need a path other than
callback, you can change that in
3. Add Your OAuth App's Client ID and Secret to .env
In this Glitch, you'll find a
.env file. In it you'll see
OAUTH_CLIENT_SECRET both without values.
In GitHub, go to the GitHub OAuth App you created in step 2. Locate the Client ID and Client Secret. Set those to the
4. Configure Your NetlifyCMS client
Use your own or the example client to complete the loop.
The key item in the client example code and readme is the
base_url setting in
config.yml. That's the hook between the client and this server.