Skip to content

kendfss/golang-oauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

oauth2 demo written in pure go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published