Spring Cloud Security JWT is Simple MicroServices project to demonstrate Spring Cloud Components and how it interacts with Config server, Discovery Server and how its performing security validation.
- Java 17
./gradlew clean build
java -jar config-service/build/libs/config-service-0.0.1.jar
java -jar discovery-service/build/libs/discovery-service-0.0.1.jar
java -jar gateway-service/build/libs/gateway-service-0.0.1.jar
java -jar auth-service/build/libs/auth-service-0.0.1.jar
java -jar cars-service/build/libs/cars-service-0.0.1.jar
curl --location --request POST 'http://localhost:8080/auth/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "password",
"name": "name"
}'
{
"accessToken": "<TOKEN>",
"refreshToken": "<TOKEN>"
}
curl --location --request GET 'http://localhost:8080/cars'
401
curl --location --request GET 'http://localhost:8080/cars' \
--header 'Authorization: <TOKEN>'
[
{
"carId": "1",
"carName": "Audi"
}
]