curl -i localhost:8000/actuator/health -H 'Host: book-service' It should return HTTP/1.1 200 {"status":"UP"} Try to call the private GET /api/books endpoint without access token curl -i localhost:8000/api/books -H 'Host: book-service' It should return HTTP/1.1 401 Unauthorized ...
POC存储库已经用these changes更新,您可以克隆并运行它以查看所需的结果。
In this study, we built a Spring Boot application and integrated it with Keycloak [27] to protect the REST APIs from unauthorized calls. We created users in Keycloak, login and generated a JWT token [43] to access the secured REST APIs. We configured the KeyCloak server with the following...