FAIR4Health Gateway to provide authentication, authorization and intelligent routing. It provides the following routing:
- [POST] /oauth/login
- [GET] /oauth/user
- Java 8+
- Maven for Java dependency management
- Spring Boot
- Spring Cloud Gateway
- Lombok for the models
- OAuth 2.0 Authentication and Authorization
- Intelligent routing
Compile and package the project with
mvn clean package
and execute
java -jar target/gateway.war
It can also be run as:
mvn spring-boot:run
Deploy the Keycloak auth repo. Execute the following curl:
curl -X POST "http://localhost:8083/oauth/login" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"password\": \"string\", \"username\": \"string\"}"
It should redirect the post to http://localhost:8081/login
and provide the following response:
{
"timestamp" : "2020-07-19T18:06:19.810+0000",
"status" : 401,
"error" : "Unauthorized",
"message" : "Unauthorised access to protected resource",
"path" : "/login"
}
OAUTH_EASY_URL=
LOGGING_FOLDER=
LOGGING_MODE=
Build the image:
docker build -t fair4health/gateway .
Simple deployment:
docker run --name gateway -d fair4health/gateway
Logging can be also configured using LOGGING_FOLDER
and sharing a volume (this is useful for example for ELK processing). The level of the logging can be configured with LOGGING_MODE
(dev|prod):
docker run --name gateway -d -v /tmp/log/gateway:/log/calculator -e LOGGING_FOLDER=/log/test -e LOGGING_MODE=dev fair4health/gateway
Apache 2.0
By downloading this software, the downloader agrees with the specified terms and conditions of the License Agreement and the particularities of the license provided.