Get started with the Zitadel integration

यह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।

⭐ Community Toolkit

Zitadel is an identity and access management service that supports OpenID Connect, OAuth 2.0, and SAML. The Aspire Community Toolkit hosting integration runs a Zitadel container and configures its PostgreSQL dependency in your AppHost.

Use this integration to develop applications against a local identity provider. It configures the first administrator account, exposes the server endpoint, and reports server health in the Aspire dashboard.

  • Declare Zitadel and PostgreSQL together instead of maintaining separate container startup scripts.
  • Pass database credentials and allocated endpoints through resource references.
  • Generate an administrator password and master key, or supply secret parameters.
  • Wait for PostgreSQL before starting Zitadel, and wait for Zitadel’s health check before starting consumers.
  • Use the exported hosting APIs from either a TypeScript or C# AppHost.
flowchart LR
    AppHost[AppHost] --> Zitadel[Zitadel container]
    AppHost --> PostgreSQL[PostgreSQL container]
    Zitadel --> PostgreSQL
    App[Consuming app] -->|OpenID Connect| Zitadel
    Browser[Browser] -->|Sign in| Zitadel

The hosting package belongs in the AppHost. PostgreSQL stores Zitadel’s data, and Zitadel initializes the database when it starts. Your application uses an OpenID Connect library to authenticate users against the Zitadel endpoint.

  1. Install the hosting packages in your AppHost:

    Aspire CLI — CommunityToolkit.Aspire.Hosting.Zitadel पैकेज जोड़ें
    aspire add zitadel

    Aspire CLI इंटरैक्टिव है; प्रॉम्प्ट पर उपयुक्त परिणाम चुनें:

    Aspire CLI — उदाहरण आउटपुट
    Select an integration to add:
    > zitadel (CommunityToolkit.Aspire.Hosting.Zitadel)
    > Other results listed as selectable options...
    Aspire CLI — Aspire.Hosting.PostgreSQL पैकेज जोड़ें
    aspire add postgres

    Aspire CLI इंटरैक्टिव है; प्रॉम्प्ट पर उपयुक्त परिणाम चुनें:

    Aspire CLI — उदाहरण आउटपुट
    Select an integration to add:
    > postgres (Aspire.Hosting.PostgreSQL)
    > Other results listed as selectable options...

    For a TypeScript AppHost, installation generates the integration bindings in ./.aspire/modules/aspire.mjs.

  2. Add PostgreSQL and attach it to Zitadel:

    apphost.mts
    import { createBuilder } from './.aspire/modules/aspire.mjs';
    const builder = await createBuilder();
    const postgres = await builder.addPostgres('postgres');
    const zitadel = await builder.addZitadel('zitadel', { port: 8080 });
    await zitadel.withDatabase(postgres);
    await builder.build().run();

    The database helper adds a database named zitadel-db, supplies PostgreSQL settings to Zitadel, and adds a database reference and startup dependency. Port 8080 is the host port; the container also listens on port 8080.

  3. Run the AppHost with aspire run. Wait for Zitadel to become healthy, then open the Zitadel Dashboard endpoint from the Aspire dashboard. Retrieve the initial credentials from the AppHost’s parameter values. The default username is admin, and the password is generated.