A new version of this repo is available here: Go Resource Server with FusionAuth.
Simple demo for using FusionAuth with Golang.
You can view the corresponding blog post: https://fusionauth.io/blog/2020/10/22/securing-a-golang-app-with-oauth/
This application will use an OAuth Authorization Code workflow and the PKCE extension to log users in. PKCE stands for Proof Key for Code Exchange, and is often pronounced “pixie”.
clone with git first
git clone https://github.com/fusionauth/fusionauth-example-go
Assuming you've configured FusionAuth with a new application, update main.go
with the client ID and client secret.
go get github.com/thanhpk/randstr
go get golang.org/x/oauth2
go get github.com/nirasan/go-oauth-pkce-code-verifier
go run main.go
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Krissanawat Kaewsanmaung - Creator