golang-oauth

command module
v0.0.0-...-25cdffc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 8 Imported by: 0

README

golang-oauth

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.

Usage

You must have go to use this. It was developed in Go 1.17. Github

  1. Register your new application on Github.
    • In the "callback URL" field, enter http://localhost:8080/oauth/redirect
    • Request a client secret
  2. Save your credentials in a file called golang-oauth/golang-creds.json using the following syntax:
    {
        "github": {
            "clientID": "",
            "clientSecret": "",
        },
        "google": {
            "clientID": "",
            "clientSecret": "",
        }
    }
    
  3. Start the server by executing go run server.go
  4. Navigate to http://localhost:8000 on your browser.

References

  1. Implementing OAuth 2.0 with Go(Golang)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL