https://github.com/jeroenvand/github-oauth-handler
https://github.com/jeroenvand/github-oauth-handler
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jeroenvand/github-oauth-handler
- Owner: jeroenvand
- Created: 2021-08-27T15:55:30.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-06T19:38:45.000Z (about 3 years ago)
- Last Synced: 2025-01-13T00:31:49.679Z (4 months ago)
- Language: Go
- Size: 61.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= Github Oauth Handler
Simple package for handling Github oauth flow.
Usage:
- create a github oauth app
- in your application, create a new Authenticator, providing the clientId and clientSecret from the app
- hook-up the Authenticator to a http mux and make sure the url/path matches what you have passed to the Authenticator as well as with the Github oauth config
- in your application, call .Token() to get a token. If you get an error/nil token, call .LoginURL() and redirect user there to login
- after successful login, you can use the Authenticator in combination with https://pkg.go.dev/golang.org/x/oauth2. You can pass the Authenticator to NewClient as a TokenSource.