github_oauth

command module
v0.0.0-...-286ce8e Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 2 Imported by: 0

README

github oauth

A simple example of the use of github oauth for the Go language

How to run?

  1. Read the github doc for create an Oauth app

  2. Set Homepage URL to http://localhost:8080/, Set Authorization callback URL to http://localhost:8080/oauth/redirect when create Oauth app

    • img.png
  3. Get Client ID and Client Secret

    • client_id and client_secret.png
  4. Populate them into dev_env or config.json

    • NOTE:
      • RedirectURL = Authorization callback URL (http://localhost:8080/oauth/redirect)
      • if dev_env and config.json simultaneously exist, dev_env data will overwrite of config.json
  5. Open you terminal, execute the following code in order:

    go get -v ./...
    
    # Can be ignored if using config.json
    source dev_env
    
    go run main.go
    
  6. Now you can do something in localhost:8080

    • img.png

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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