Skip to content

Netlify-CMS oauth client sending token in form as Netlify service itself, implementation in Go (golang)

License

Notifications You must be signed in to change notification settings

usrpro/netlify-cms-oauth-provider-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

netlify-cms-oauth-provider-go

Build Status Go Report Card Downloads Latest release

Netlify-CMS oauth client sending token in form as Netlify service itself, implementation in Go (golang)

inspired by netlify-cms-github-oauth-provider (node-js). Thanks Václav!

1) Install

# binary will be $GOPATH/bin/netlify-cms-oauth-provider-go
curl -sfL https://raw.githubusercontent.com/igk1972/netlify-cms-oauth-provider-go/master/install.sh | sh -s -- -b $GOPATH/bin

# or install it into ./bin/
curl -sfL https://raw.githubusercontent.com/igk1972/netlify-cms-oauth-provider-go/master/install.sh | sh -s

# In alpine linux (as it does not come with curl by default)
wget -O - -q https://raw.githubusercontent.com/igk1972/netlify-cms-oauth-provider-go/master/install.sh | sh -s

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:

HOST=localhost:3000
BASE=localhost:3000
SESSION_SECRET=your-random-string
GITHUB_KEY=
GITHUB_SECRET=
BITBUCKET_KEY=
BITBUCKET_SECRET=
GITLAB_KEY=
GITLAB_SECRET=

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.

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.

backend:
  name: github
  repo: user/repo   # Path to your Github repository
  branch: master    # Branch to update
  base_url: https://your.server.com # Path to ext auth provider

About

Netlify-CMS oauth client sending token in form as Netlify service itself, implementation in Go (golang)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 55.1%
  • Go 38.1%
  • Makefile 3.8%
  • Dockerfile 3.0%