🚀 Our inaugural State of Local Development and Testing report is live! Explore insights & best practices now

Documentation

Java Go .NET

Community Modules

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

var keycloak = new KeycloakContainer();
keycloak.start();
container, 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"),
)
var keycloakContainer = new KeycloakBuilder()
  .WithImage("quay.io/keycloak/keycloak:21.1")
  .Build();
await keycloakContainer.StartAsync();