A powerful Micronaut-based toolkit for generating and managing JWT tokens for testing purposes. Perfect for developers who need to simulate identity provider tokens during development and testing phases using JWKS endpoint.
- 🎯 Generate JWT tokens with custom claims
- 🔑 JWKS endpoint for key management. See JWKS Configuration
- 🔄 Support for common identity providers:
- AWS Cognito
- Okta
- Custom
- 📚 Interactive Swagger UI documentation
- 🏥 Health check endpoints for Kubernetes
- 🐳 Docker support
- ⚡ Native image support with GraalVM
- ⎈ Helm chart for easy deployment on Kubernetes
- Java 21 or higher
- Gradle 8.x (included via wrapper)
-
Clone the repository:
git clone https://github.com/rjaros87/JWTTestKit.git cd JWTTestKit
-
Build and run using Gradle:
./gradlew run
Or build a native image:
./gradlew nativeCompile
-
The application will start on port 8080 by default
Build Docker image:
./gradlew dockerBuild
Build native Docker image:
./gradlew dockerBuildNative
To deploy the JWT Test Kit on Kubernetes, you can use the provided Helm chart. Follow these steps:
- Add the Helm repository:
helm repo add jwt-testkit https://rjaros87.github.io/JWTTestKit
- Update the Helm repository:
helm repo update
- Install the JWT Test Kit chart:
helm install jwt-testkit jwt-testkit/jwt-testkit
- Access the application using the service name
jwt-test-kit
and the port default port 80 for http in your Kubernetes cluster.
- Swagger UI: Access the interactive API documentation at http://localhost:8080/api
- OpenAPI Spec: Available at http://localhost:8080/swagger/api.yml
- URL:
/health
- Method:
GET
- Port: 8082 (configurable via
MANAGEMENT_PORT
)
Key configurations can be adjusted in application.yml
:
- Server ports
- JWT signing keys
- Token expiration times
- Management endpoints
To configure JWKS in your Micronaut application, add the following properties to your application.yml
file:
micronaut:
security:
enabled: true
token:
jwt:
signatures:
jwks:
custom:
url: http://localhost:8080/JWTTestKit/jwks
You can configure the application using the following environment variables:
APPLICATION_PORT
– The port on which the JWT Test Kit application runs (default:8080
).APPLICATION_HOST
– The host address where the JWT Test Kit application runs (default:localhost
).APPLICATION_SCHEME
– The protocol used by the JWT Test Kit application (default:http
).
./gradlew clean build
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.