Skip to content

Commit ae2f1ea

Browse files
authored
Merge pull request #19 from Nasruddin/feature/authorization-server-impl
Feature/authorization server impl
2 parents 4bd88ef + 2e08a9b commit ae2f1ea

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,50 @@
11
# spring-boot-based-microservices
22

3-
Basic skeleton for Spring Boot Microservices. It includes spring spring security for basic Auth. Spring cloud gateway is also implemented as an Edge Service. Lots of the spring cloud component integrated.
3+
Basic skeleton for Spring Boot Microservices. It includes spring security for basic Auth. Spring cloud gateway is also implemented as an Edge Service. Lots of the spring cloud component integrated.
44

5+
# How to run
6+
7+
- Navigate to root of the project
8+
```
9+
cd spring-boot-based-microservices
10+
```
11+
- Build the project
12+
```
13+
mvn clean package -DskipTests
14+
```
15+
![Maven Build](https://github.com/Nasruddin/spring-boot-based-microservices/blob/master/images/build.png?raw=true)
16+
17+
- Locate the docker directory from the root directory and run docker compose to startup the containers
18+
```
19+
cd docker && docker-compose up --build
20+
```
21+
![Docker Compose Build](https://github.com/Nasruddin/spring-boot-based-microservices/blob/master/images/docker-compose.png?raw=true)
22+
23+
- Check if all our services are running and healthy
24+
```
25+
docker ps
26+
```
27+
![Docker PS](https://github.com/Nasruddin/spring-boot-based-microservices/blob/master/images/docker-ps.png?raw=true)
28+
29+
- Let's check if all the services are up and running. We will reach to eureka server using gateway.
30+
Open the browser and hit http://localhost:8443/eureka/web You will need to authenticate yourself before accessing the endpoint.
31+
```
32+
username : user
33+
password : password
34+
```
35+
![Eureka](https://github.com/Nasruddin/spring-boot-based-microservices/blob/master/images/eureka.png?raw=true)
36+
37+
- Now, we have a look at our gateway endpoints configurations as well. Hit http://localhost:8443/actuator/gateway/routes in the browser again and, you should be able to find all the routes configured.
38+
![Gateway Routes](https://github.com/Nasruddin/spring-boot-based-microservices/blob/master/images/gateway-routes.png?raw=true)
39+
40+
41+
- Coming to swagger/openapi specs, here is the address to access them - http://localhost:8443/openapi/swagger-ui.html
42+
![Swagger OpenApi Specs](https://github.com/Nasruddin/spring-boot-based-microservices/blob/master/images/swagger-openapi.png?raw=true)
43+
44+
- Please use the below curl to generate the access token with both read and write scope.
45+
```
46+
curl -k http://writer:secret-writer@localhost:8443/oauth2/token -d grant_type=client_credentials -d scope="course:read course:write"
47+
```
48+
![Swagger OpenApi Specs](https://github.com/Nasruddin/spring-boot-based-microservices/blob/master/images/oauth-endpoint.png?raw=true)
49+
![Swagger OpenApi Specs](https://github.com/Nasruddin/spring-boot-based-microservices/blob/master/images/jwt-io.png?raw=true)
50+
## Note : Currently this project uses Spring Authorization server. Keep in mind, I'm planning to enhance the whole OAuth flow because it's in shaky state right now and, you may some face issues. We may also move to keycloak.

images/swagger-openapi.png

371 KB
Loading

0 commit comments

Comments
 (0)