Skip to content

This is an example project for automating tests on a Spring Boot application secured with OAuth 2.0. The tests will be conducted using Keycloak Testcontainers, Playwright and GitLab pipelines.

Notifications You must be signed in to change notification settings

inoteq/spring-boot-keycloak-oauth2-testing

Repository files navigation

Spring Boot

To run the spring boot application, execute the following command in the root directory of the project:

./gradlew bootRun

The application is then available at http://localhost:8080. There are three endpoints available:

  • / or /public: accessible without authentication
  • /private - accessible with authentication
  • /private/user - accessible with authentication and prints the user information

Keycloak

To create a preconfigured Keycloak container, make sure Docker is running on your system and execute the following command in the root directory of the project:

docker-compose up --build

Keycloak is then available at http://localhost:8081. The Keycloak container is preconfigured. To log into the administation console, use the following credentials:

  • Username: admin
  • Password: admin

A realm specifically configured for this application is imported automatically. You can use the following credentials to log in to the application:

  • Username: john.doe
  • Password: password

About

This is an example project for automating tests on a Spring Boot application secured with OAuth 2.0. The tests will be conducted using Keycloak Testcontainers, Playwright and GitLab pipelines.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages