Keycloak support for Aspire.
Install
| Product | Versions |
|---|---|
| .NET |
README
Keycloak hosting integration
Use this integration to model, configure, and orchestrate a Keycloak resource in an Aspire solution.
Getting started
Add the integration
From your AppHost directory, add the Aspire.Hosting.Keycloak integration with the Aspire CLI:
aspire add Aspire.Hosting.Keycloak
Usage example
In the AppHost, add a Keycloak resource and enable service discovery with either C# or TypeScript:
C#
var keycloak = builder.AddKeycloak("keycloak", 8080);
var myService = builder.AddProject<Projects.MyService>()
.WithReference(keycloak);
TypeScript
const keycloak = await builder.addKeycloak("keycloak", 8080);
const myService = await builder.addNodeApp("myService", "../my-service", "server.js")
.withReference(keycloak);
Recommendation: For local development use a stable port for the Keycloak resource (8080 in the example above). It can be any port, but it should be stable to avoid issues with browser cookies that will persist OIDC tokens (which include the authority URL, with port) beyond the lifetime of the AppHost.
Additional documentation
https://aspire.dev/integrations/gallery/ https://aspire.dev/integrations/security/keycloak/
Feedback & contributing
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.