https://github.com/famesensor/playground-go-grpc-authentication
This project is an example of how to implement authentication in a Go gRPC service using JWT.
https://github.com/famesensor/playground-go-grpc-authentication
golang grcp jwt
Last synced: 6 months ago
JSON representation
This project is an example of how to implement authentication in a Go gRPC service using JWT.
- Host: GitHub
- URL: https://github.com/famesensor/playground-go-grpc-authentication
- Owner: famesensor
- Created: 2024-11-25T16:11:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-09T15:36:55.000Z (over 1 year ago)
- Last Synced: 2025-01-09T15:37:33.021Z (over 1 year ago)
- Topics: golang, grcp, jwt
- Language: Go
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Go gRPC Authentication
This project is an example of how to implement authentication in a Go gRPC service using JWT.
## Features
* User registration and login
* JWT token generation and verification
* gRPC interceptor for authentication
## Technologies
* Go
* gRPC
* Protocol Buffers
* JWT
## Requirements
* Go 1.16+
* gRPC 1.40+
* Protocol Buffers 3.15+
## Installation
1. Clone the repository
2. Run `go build` to build the binary
3. Run `go run main.go` to start the service
## Usage
1. Register a new user using the `proto.AuthService.SignUp` method
2. Login using the `proto.AuthService.SignIn` method
3. Use the `proto.AuthService.SignIn` method to authenticate requests
### Future Improvements
* Add client(gRPC)
* Add error handling and logging
* Add health check
* Add TLS
* Improve code style
### References
* [Protocol Buffers](https://developers.google.com/protocol-buffers/)
* [gRPC](https://grpc.io/)
* [use-grpc-interceptor-for-authorization-with-jwt](https://dev.to/techschoolguru/use-grpc-interceptor-for-authorization-with-jwt-1c5h)