This repo contains an Oath2 authenticator in pure go, html and js.
It's an extension of a tutorial by Soham Kamani1 which also implements support for authentication via google, and use of json/p to manage credentials.
Credentials aren't secured, yet. Do not use this in production.
You must have go to use this. It was developed in Go 1.17. Github
- Register your new application on Github.
- In the "callback URL" field, enter
http://localhost:8080/oauth/redirect
- Request a client secret
- In the "callback URL" field, enter
- Save your credentials in a file called
golang-oauth/golang-creds.json
using the following syntax:{ "github": { "clientID": "", "clientSecret": "", }, "google": { "clientID": "", "clientSecret": "", } }
- Start the server by executing
go run server.go
- Navigate to
http://localhost:8000
on your browser.