🚨 AtomicJar is now part of Docker 🐋! Read the blog

Community Module

These modules are maintained by the community, outside of the Testcontainers project.

Description

Keycloak is an open source identity and access management application that provides user federation, strong authentication, user management, fine-grained authorization, and more.

Examples

Dependency:
<dependency>
    <groupId>com.github.dasniko</groupId>
    <artifactId>testcontainers-keycloak</artifactId>
    <version>3.4.0</version>
    <scope>test</scope>
</dependency>
Usage:
var keycloak = new KeycloakContainer();
keycloak.start();
Dependency:
go get github.com/stillya/testcontainers-keycloak
Usage:
keycloakContainer, err := keycloak.RunContainer(ctx,
  testcontainers.WithImage("quay.io/keycloak/keycloak:21.1"),
  testcontainers.WithWaitStrategy(wait.ForListeningPort("8080/tcp")),
  keycloak.WithContextPath("/auth"),
  keycloak.WithRealmImportFile("../testdata/realm-export.json"),
  keycloak.WithAdminUsername("admin"),
  keycloak.WithAdminPassword("admin"),
)
Dependency:
dotnet add package Testcontainers.Keycloak --version 3.9.0
Usage:
var keycloakContainer = new KeycloakBuilder()
  .WithImage("quay.io/keycloak/keycloak:21.1")
  .Build();
await keycloakContainer.StartAsync();
Dependency:
pip install testcontainers[keycloak]
Usage:
with KeycloakContainer() as keycloak:
    client = keycloak.get_client()