Skip to content

pjsier/serverless-netlify-oauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless Netlify OAuth Provider

Based on vencax/netlify-cms-github-oauth-provider, sets up a GitHub OAuth provider for Netlify CMS authentication.

Setup

Set up serverless according to their documentation. Then install dependencies with npm install, and deploy the initial application with sls deploy. In the command line output you'll see the URL of your endpoint (something like https://{API_ID}.execute-api.us-east-1.amazonaws.com/dev/).

API Gateway Setup

Because Netlify is checking the origin in OAuth requests and raw API Gateway URLs include the stage (i.e. /dev/), you'll need to associate a custom domain name with your API Gateway endpoint.

Then, create a GitHub OAuth app according to the GitHub developer documentation. The callback URL should be the API Gateway custom endpoint followed by /callback. Once you've set that up, copy the .env.yml.sample to .env.yml, and fill in the client ID and secret.

You'll need to add base_url to your CMS config file, which will be the custom API Gateway endpoint without a trailing slash.

About

Netlify CMS GitHub OAuth with the Serverless framework

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published