https://github.com/fusionauth/fusionauth-example-go-jwt-microservices
Example of a golang API gateway with authorization using JWT
https://github.com/fusionauth/fusionauth-example-go-jwt-microservices
Last synced: about 1 year ago
JSON representation
Example of a golang API gateway with authorization using JWT
- Host: GitHub
- URL: https://github.com/fusionauth/fusionauth-example-go-jwt-microservices
- Owner: FusionAuth
- License: apache-2.0
- Created: 2021-02-16T21:51:45.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-07-28T05:55:02.000Z (almost 2 years ago)
- Last Synced: 2024-07-28T06:45:40.941Z (almost 2 years ago)
- Language: Go
- Size: 6.84 KB
- Stars: 10
- Watchers: 12
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# FusionAuth golang microservices example
This code is an example of protecting golang microservices with JSON web tokens.
Read the blog post here: https://fusionauth.io/blog/2021/02/18/securing-golang-microservice/
## To run
This assumes you already have go 1.15.8 installed and have cloned this repo.
In one terminal:
* cd jwt_client
* go get
* go run main.go
In another terminal:
* cd api_gateway
* go get
* go run main.go
In yet another terminal:
* curl http://localhost:8080 # to get the JWT
* curl http://localhost:9001 --header 'Token: [jwt value]' # to get the secret microservice response
Original code by @krissnawat