string Code { get; }
Source
Gets the stable AppSurface Keycloak diagnostic code.
Adds AppSurface local Keycloak proof resources to Aspire AppHosts.
AppSurfaceKeycloakResource AddAppSurfaceKeycloak(this IDistributedApplicationBuilder builder, string name = AppSurfaceKeycloakDefaults.ResourceName, Action<AppSurfaceKeycloakOptions>? configure = null)
Source
Adds an official Aspire Keycloak resource configured with deterministic AppSurface local OIDC proof defaults.
builderThe distributed application builder.nameThe Aspire resource name.configureOptional callback that customizes local proof options.An AppSurface wrapper exposing the underlying Keycloak resource, secret-safe config projection, and readiness probe.
Represents a safe AppSurface Keycloak proof diagnostic with a stable code.
string Code { get; }
Source
Gets the stable AppSurface Keycloak diagnostic code.
Captures safe readiness evidence for the AppSurface Keycloak local proof.
AuthorityThe verified Keycloak realm authority.ClientIdThe verified public client id.RealmThe verified realm id.Resolves safe local paths for generated Keycloak realm import artifacts.
string GetDefaultImportDirectory()
Source
Gets the default realm import directory without creating it.
The default directory beneath the application base directory.
string ResolveImportDirectory(string rootDirectory, string resourceName)
Source
Resolves a resource-specific realm import directory without creating it.
rootDirectoryRoot directory that owns generated realm imports.resourceNameResource name used as one safe path segment.The resolved import directory.
string GetRealmImportFilePath(string realmImportDirectory, string realm)
Source
Resolves the generated realm import file beneath an import directory.
realmImportDirectoryDirectory that contains realm imports.realmRealm id used in the generated file name.The safe realm import file path.
Performs bounded, multi-signal readiness checks for the AppSurface local Keycloak proof.
Task<AppSurfaceKeycloakReadinessResult> CheckOnceAsync(CancellationToken cancellationToken = default)
Source
Checks metadata, generated realm evidence, and authorization challenge evidence once.
cancellationTokenCancellation token for HTTP work.A successful readiness result.
Stable diagnostic codes emitted by the AppSurface Keycloak AppHost proof package.
Secret-safe app configuration produced by the AppSurface Keycloak proof package.
The projection only contains OIDC authority, client id, callback paths, and the public-client secret policy. It never contains admin credentials, seeded user passwords, realm JSON, tokens, raw claims, or client secrets.
IResourceBuilder<ProjectResource> ApplyTo(IResourceBuilder<ProjectResource> project)
Source
Applies the allowlisted environment variables to an Aspire project resource.
projectThe project resource builder.The same project resource builder for chaining.
string Authority { get; }
Source
Gets the local Keycloak realm authority.
string ClientId { get; }
Source
Gets the local public client id.
string CallbackPath { get; }
Source
Gets the OIDC callback path.
string SignedOutCallbackPath { get; }
Source
Gets the OIDC signed-out callback path.
bool RequireClientSecret { get; }
Source
Gets a value indicating whether the paired proof app should require a client secret.
IReadOnlyDictionary<string, string> EnvironmentVariables { get; }
Source
Gets the allowlisted environment variables used by the proof web app.
Configures the deterministic local Keycloak realm and public client used for AppSurface OIDC proof AppHosts.
void Validate()
Source
Validates all local Keycloak proof options and populates default redirect URIs when needed.
AppSurfaceKeycloakConfigurationProjection CreateConfigurationProjection()
Source
Builds the secret-safe configuration projection for the paired web proof.
An immutable projection containing only allowlisted OIDC configuration.
string Realm { get; set; }
Source
Gets or sets the local Keycloak realm name.
string ClientId { get; set; }
Source
Gets or sets the local public OIDC client id.
string ClientDisplayName { get; set; }
Source
Gets or sets the local display name imported for the OIDC client.
string CallbackPath { get; set; }
Source
Gets or sets the OIDC callback path used by the web proof.
string SignedOutCallbackPath { get; set; }
Source
Gets or sets the OIDC signed-out callback path used by the web proof.
int KeycloakPort { get; set; }
Source
Gets or sets the fixed local Keycloak host port.
int WebProofPort { get; set; }
Source
Gets or sets the fixed local web proof port used to build redirect URIs.
bool UsePersistentDataVolume { get; set; }
Source
Gets or sets a value indicating whether Keycloak data should persist in a container volume.
Disposable data is the default so realm import is deterministic. Persistent data keeps admin credentials and imported realm state until the volume is deleted.
string RealmImportDirectory { get; set; }
Source
Gets or sets the directory that receives generated Keycloak realm import JSON.
IList<Uri> RedirectUris { get; }
Source
Gets mutable redirect URIs imported into the public OIDC client.
IList<Uri> PostLogoutRedirectUris { get; }
Source
Gets mutable post-logout redirect URIs imported into the public OIDC client.
IList<AppSurfaceKeycloakUserOptions> SeededUsers { get; }
Source
Gets mutable local-only users imported into the proof realm.
Describes a deterministic local-only user imported into the AppSurface Keycloak proof realm.
void Validate()
Source
Validates the seeded user's username, subject, password, display name, and claim entries.
AppSurfaceKeycloakExceptionA seeded user option is invalid.string Username { get; }
Source
Gets the local Keycloak username.
string Password { get; }
Source
Gets the temporary local-only password used by Keycloak realm import.
This value is intentionally never included in runtime app configuration projection.
string Subject { get; }
Source
Gets the stable OIDC subject value.
string DisplayName { get; }
Source
Gets the local display name used by the proof UI.
IDictionary<string, string> Claims { get; }
Source
Gets local-only user attributes that should be imported and optionally mapped to claims.
Default local-only values used by the AppSurface Keycloak AppHost proof package.
These defaults intentionally mirror the AppSurface OIDC package callback paths without taking a runtime dependency on that package. Drift is covered by tests so the AppHost proof package does not become part of web auth registration.
string Authority(string realm = Realm, int port = KeycloakPort)
Source
Builds the default authority URL for a local realm and port.
realmThe Keycloak realm name.portThe local Keycloak host port.The local HTTP authority URL.
Provides early local fixed-port diagnostics before Aspire starts containers or projects.
void ThrowIfOccupied(int port, string optionName)
Source
Throws a safe diagnostic when a configured fixed port is already occupied.
portThe local TCP port to check.optionNameThe option name that supplied the fixed port.bool IsAvailable(int port)
Source
Returns whether a local TCP port can be bound at preflight time.
portThe local TCP port to check.true when the port can be bound; otherwise false.
Generates deterministic Keycloak realm import JSON for the AppSurface local proof.
string Generate(AppSurfaceKeycloakOptions options)
Source
Generates deterministic realm import JSON from validated options.
optionsThe Keycloak proof options.A JSON document suitable for Keycloak startup realm import.
string WriteRealmImport(AppSurfaceKeycloakOptions options)
Source
Writes deterministic realm import JSON into the configured import directory.
optionsThe Keycloak proof options.The written realm import file path.
Wraps the official Aspire Keycloak resource with AppSurface local proof metadata.
IResourceBuilder<KeycloakResource> Resource { get; }
Source
Gets the underlying Aspire Keycloak resource builder for normal Aspire APIs such as WithReference and WaitFor.
AppSurfaceKeycloakConfigurationProjection Configuration { get; }
Source
Gets the secret-safe web configuration projection.
AppSurfaceKeycloakReadinessProbe Readiness { get; }
Source
Gets the readiness probe.
string RealmImportFile { get; }
Source
Gets the generated realm import file path.