github

command
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

Basic Github oAuth Testing

Obtain a GitHub application client id and secret from developer settings. Add http://localhost:8080/github/callback as a valid OAuth2 Redirect URL.

Example App

main.go shows an example web app that issues a client-side cookie session. Pass the GitHub client id and secret as arguments or set the GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET environment variables.

go run main.go -client-id=xx -client-secret=yy
2015/09/25 23:09:13 Starting Server listening on localhost:8080

User

/* To check github token we can use the following API call: curl -v -H "Authorization: Bearer $token" https://api.github.com/user it will return something like this: { "login": "UserName", "id": UserID, "type": "User", "name": "First Last name", "company": "Company Name", "location": "City, State", "bio": "Title associated with user", } */

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