Skip to content

DanielRosenkranz/spring-webflux-keycloak-angular

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring WebFlux with Keycloak and Angular SSO Example

Features

  • Spring WebFlux as Resource Server.

  • Keycloak as OIDC provider.

  • Angular application with SSO.

  • App store example

  • Launch Employee Angular front end directly or using app store.

  • Two roles Admin and user roles supported.

  • Admin can perform CRUD operations.

  • User role can view only.

  • Role validation is done both at frontend and backend.

  • username and password - admin → admin1/password - user → user1/password

How to run using docker-compose [WIP]

  • Replace all occurance of IP Address in keycloak/universal-realm.json with your host IP Address.

  • Replace all occurance of IP Address in docker-compose.yml with your host IP Address.

  • Start the applications using docker-compose

    $ docker-compose up -d
  • Now you can access the application at url `http://<host-ip>

Note

To rebuild and run single container

$ docker-compose up -d --force-recreate --no-deps --build -V <service-name>

How to run apps using ng serve with just keycloak using docker.

  • Change application redirect uri ipaddress to host ip where the application will run in keycloak/universal-realm.json

  • Change employee-app ipaddress in app-store app-store/src/app/assets/config/apps.json to host IP where the application will be running.

  • Change keycloak ipaddress in app-store app-store/src/app/assets/config/oidc.json to host IP where the keycloak will be running.

  • Change keycloak ipaddress in employee-app employee-app/src/app/assets/config/oidc.json to host IP where the keycloak will be running.

  • Change employee-backend ipaddress in employee-app employee-app/proxy-config.json to host IP where the employee-backend will be running.

  • Change keycloak ipaddress in employee-backend employee-backend/src/main/resources/application.yml to host IP where the keycloak will be running.

  • start keycloak

    docker-compose up -d keycloak
  • Build and start app-store

    $ cd app-store
    $ npm install
    $ ng serve --host 0.0.0.0 --ssl
  • Build and start emplyee-app

    $ cd emplyee-app
    $ npm install
    $ ng serve --host 0.0.0.0 --port 4201 --ssl
  • start employee backend

    $ cd employee-backend
    $ mvn spring-boot:run
  • now app-store can be accessed on url https://localhost:4200

About

Example project for spring webflux with keycloak and angular(SSO)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 65.1%
  • HTML 15.3%
  • Java 7.4%
  • Go 4.1%
  • Dockerfile 3.8%
  • JavaScript 3.6%
  • SCSS 0.7%