https://github.com/yukigeshiki/grpc-auth-service-java
An experimental gRPC authentication service using Spring Boot and GCP Identity Platform.
https://github.com/yukigeshiki/grpc-auth-service-java
authentication-service gcp grpc grpc-java grpc-server identity-platform spring-boot
Last synced: 2 months ago
JSON representation
An experimental gRPC authentication service using Spring Boot and GCP Identity Platform.
- Host: GitHub
- URL: https://github.com/yukigeshiki/grpc-auth-service-java
- Owner: Yukigeshiki
- License: mit
- Created: 2025-03-27T16:51:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-02-17T18:56:16.000Z (4 months ago)
- Last Synced: 2026-02-17T23:57:21.896Z (4 months ago)
- Topics: authentication-service, gcp, grpc, grpc-java, grpc-server, identity-platform, spring-boot
- Language: Java
- Homepage:
- Size: 93.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grpc-auth-service-java
[](https://github.com/Yukigeshiki/grpc-auth-service-java/actions/workflows/ci.yml)
An experimental gRPC authentication service using Spring Boot and GCP Identity Platform.
## Prerequisites
- Java 23
- [grpcurl](https://github.com/fullstorydev/grpcurl) (for testing)
## Running the Application
```
./gradlew clean bootRun
```
A JWT token is sent through to the service as an "Authorization: Bearer token" metadata pair. The service decodes the token and returns an `AuthResponse` on success, or a gRPC `UNAUTHENTICATED` error on failure.
## Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| `PROJECT_ID` | `grpc-identity-platform-test` | GCP project ID for Firebase auth |
| `ISSUER_URI` | `https://securetoken.google.com/` | JWT issuer base URI |
| `GRPC_REFLECTION_ENABLED` | `false` | Enable gRPC reflection (disable in production) |
## Testing
To test you can set up simple email/password auth in [Identity Platform](https://cloud.google.com/identity-platform/docs), then run the below curl command to get a token. Remember to set the `PROJECT_ID` environment variable to your GCP project ID.
```
curl -X POST "https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=" \
-H "Content-Type: application/json" \
-d '{
"email": "",
"password": "",
"returnSecureToken": true
}'
```
Once the above is completed and you have a token, run:
```
grpcurl -plaintext \
-emit-defaults \
-d '{}' \
-H "Authorization: Bearer " \
localhost:9090 AuthService/Authenticate
```
To run auth service tests:
```
./gradlew clean check
```