Path: redb-identity/context.sample.json Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity Page: https://redbase.app/src/dev-2026-12-06/redb-identity/context.sample.json ---- { "//": [ "redb.Identity — UNIFIED external context.json (Tsak Layer 3).", "", "PER-CONTEXT format (introduced together with TsakCoordinator support for", "'Contexts:' root section): every key is scoped to a specific context (or the", "shared 'default' bucket). Mirrors the host-appsettings shape exactly:", " Tsak:Contexts:default ↔ Contexts.default", " Tsak:Contexts:{ctxName} ↔ Contexts.{ctxName}", "", "Devops single source of truth for both .tpkg modules:", " - redb.Identity.Core.Module.tpkg (context 'identity.core')", " - redb.Identity.Http.tpkg (context 'identity.http')", "", "DEPLOY: copy this file into the same Libs/ folder as the .tpkg files.", "TsakCoordinator.LoadModuleConfigFiles parses {Libs}/context.json once per module:", " 1. merge Contexts.default (shared by every context),", " 2. merge Contexts.{moduleContextName} on top (context-specific overrides win).", "Sections for OTHER contexts are simply ignored when loading a given module.", "", "LEGACY-FALLBACK: if 'Contexts:' is absent, all root keys are merged flat for", "every module (old behaviour) — keeps existing context.json files working.", "", "5-LAYER PIPELINE:", " L1 host appsettings: Tsak:Contexts:default:*", " L2 host appsettings: Tsak:Contexts:{ctxName}:*", " L3 THIS file: Contexts.default + Contexts.{ctxName}", " L4 in-tpkg stub: ContextName + AutoStart only (module identity)", " L5 Override (wins): Tsak:Contexts:{ctxName}:Override:*", "", "Environment-variable overrides (.NET IConfiguration mapping):", " Tsak__Contexts__identity.core__Override__Identity__AccessTokenLifetime=01:00:00", " Tsak__Contexts__identity.core__Override__Identity__RateLimit__Enabled=true", " Tsak__Contexts__identity.http__Override__IdentityTransport__Http__PublicPort=5002", "", "SECRETS — never commit real secrets to this file. Supply via L5 Override:", " Identity:RecoveryCodePepper (base64 random)", " Identity:SeedBackchannelClient:ClientSecret (base64 random; SAME value also set as Identity__BackchannelClient__ClientSecret on the Web BFF)", " Identity:DynamicRegistrationInitialAccessToken (bearer token)", " Identity:FederationProviders[i]:ClientSecret (per provider)", " Identity:Ldap:Providers[i]:BindPassword (per provider)", " Identity:RateLimit:RedisConnectionString (if Redis backend)", " Identity:FederationState:RedisConnectionString (if Redis backend)", " Redb:{instance}:ConnectionString (DB credentials)", "", "LOGGING — log-level overrides DO NOT belong in this file. Serilog is wired in", "redb.Tsak.Worker/Program.cs via UseSerilog(.ReadFrom.Configuration(...)) and reads", "from the ROOT 'Serilog:*' section of the host configuration. TsakCoordinator merges", "context.json only into the per-context bucket 'Tsak:Contexts:{ctxName}:*' (which", "then binds the module Options classes), so anything written here under a 'Serilog'", "key — or as an L5 Override env-var like Tsak__Contexts__identity.core__Override__Serilog__... —", "lands in a namespace Serilog doesn't read. Identity-stack noise (OpenIddict per-", "request INF, etc.) is silenced in:", " redb.Tsak/src/redb.Tsak.Worker/appsettings.json -> Serilog:MinimumLevel:Override", "Or as an env-var directly on the root key:", " Serilog__MinimumLevel__Override__OpenIddict=Warning" ], "Contexts": { "//default": [ "Shared bucket: keys here are merged into EVERY context loaded from this folder.", "Use only for things that genuinely need to be the same across contexts:", " • Redb named instances (DataProtection key-ring lives in this DB — must match).", " • RedbInstanceName (HTTP facade reads it as a top-level property)." ], "default": { "Redb": { "identity-pg": { "Provider": "postgres", "UsePro": true, "PropsSaveStrategy": "ChangeTracking", "ConnectionString": "Host=localhost;Port=5432;Username=postgres;Password=;Database=redb;Pooling=true;Include Error Detail=true;Options=-c jit=off", "EnsureCreated": true }, "identity-mssql": { "Provider": "mssql", "UsePro": true, "PropsSaveStrategy": "ChangeTracking", "ConnectionString": "Server=127.0.0.1,1433;Database=redb;User Id=sa;Password=;TrustServerCertificate=true;Command Timeout=600;", "EnsureCreated": true }, "identity-sqlite": { "//": "SQLite mirror — toggle 'RedbInstanceName' below to switch the whole Identity stack to SQLite. EnsureCreated bootstraps the schema on first run. Pro tier so PropsSaveStrategy=ChangeTracking works.", "Provider": "sqlite", "UsePro": true, "PropsSaveStrategy": "ChangeTracking", "ConnectionString": "Data Source=identity-redb.db;Mode=ReadWriteCreate", "EnsureCreated": true } }, "//RedbInstanceName": "Switch this between 'identity-pg' and 'identity-sqlite' to flip the entire Identity stack between providers. The Identity:RedbInstanceName under identity.core defaults to the same name.", "RedbInstanceName": "identity-sqlite" }, "//identity.core": [ "Read by IdentityModuleConfigBinder.Bind → RedbIdentityOptions.", "Identity:* keys live here. The HTTP facade (identity.http) ignores this section." ], "identity.contracts": { "//": [ "The contracts CARRIER (redb.Identity.Contracts.tpkg) - an empty module whose payload is", "redb.Identity.Contracts.dll, the one process-wide instance of the DTO assembly all Identity", "modules resolve against. It has NO settings: this section exists so the operator's single", "source of truth lists every Identity context. Deployment rule: redeploy this package only", "when the contracts change, and then redeploy every Identity module after it - a contract", "change requires that in any architecture. Reloading core/facades alone never touches it." ] }, "identity.core": { "Identity": { "//RedbInstanceName": "Must match Contexts.default.RedbInstanceName above. Flip between 'identity-pg' and 'identity-sqlite' (or any other instance you register in Contexts.default.Redb) to switch the whole Identity stack between providers.", "RedbInstanceName": "identity-sqlite", "Issuer": "https://host.docker.internal:5002", "//IssuerNote": "MUST match redb.Identity.Web appsettings.json -> Identity:Authority / Identity:ApiBaseUrl and the Issuer claim emitted in id_token. PROD: front with a TLS-terminating reverse proxy and set Issuer to the public https URL.", "//RequirePkce": "Mandatory PKCE (OAuth 2.1) is the in-code default (true). Set false to ALSO accept plain authorization_code without a code_challenge — required to certify the OpenID 'Basic OP' profile, whose non-PKCE tests expect the OP to accept such requests. PKCE, when sent, is still S256-only. PROD: leave true (or omit).", "RequirePkce": false, "AllowEphemeralKeys": false, "//UsePropsSigningKeyStore": [ "When true, signing keys are persisted in the props store (DataProtection-encrypted)", "and the JWKS endpoint serves them live from the store on every request —", "admin /signing-keys/rotate + /retire reflect in the JWKS immediately without", "process restart. Required for the demo_jwks_rotation probe.", "Caveat: OpenIddict still picks the signing credential for NEW tokens from its", "frozen options.SigningCredentials list, populated at startup. After admin rotate,", "new tokens continue using the OLD kid until the OpenIddict cache refreshes", "(process restart, or a future IOptionsMonitor wiring — separate batch).", "Dev relaxes DataProtection.RequireAtRestEncryption because no MasterKey is", "configured locally — production deployments MUST configure one of:", "DataProtection.MasterKey (32-byte base64), .Certificate.Thumbprint,", ".Certificate.PfxPath, or .CustomEncryptorFactory." ], "UsePropsSigningKeyStore": true, "DataProtection": { "RequireAtRestEncryption": false }, "AccessTokenLifetime": "01:00:00", "RefreshTokenLifetime": "14.00:00:00", "RefreshTokenReuseLeeway": "00:00:00", "AuthorizationCodeLifetime": "00:05:00", "IdentityTokenLifetime": "00:05:00", "DisableAccessTokenEncryption": false, "TokenThrottleMaxPerPeriod": 10, "TokenThrottlePeriod": "00:00:01", "//DynamicRegistrationThrottle": [ "DCR rate-limit (per remote IP). The in-code default of 5 per 10 s now ships with", "RFC 6585 semantics (the throttle was switched to .RejectOnOverflow() — overflow", "returns 429 + Retry-After instead of silently semaphore-waiting). Dev still bumps", "the budget so the run_all suite, which DCRs many clients back-to-back from the", "same loopback IP, doesn't trip the rate limit during normal development. A", "dedicated demo (demo_throttle_rfc6585) exercises the 429 contract.", "Production should KEEP the in-code default 5/10 s (or tighter) for security." ], "DynamicRegistrationThrottleMaxPerPeriod": 100, "DynamicRegistrationThrottlePeriod": "00:00:01", "TokenRetentionDays": 30, "TokenCleanupInterval": "01:00:00", "TokenCleanupBatchSize": 50, "SessionRetentionDays": 14, "SessionCleanupInterval": "01:00:00", "SessionCookieLifetime": "08:00:00", "ManagementScope": "identity:manage", "AccountScope": "identity:account", "//Features": [ "Single source of truth for module-level on/off toggles. Both Core (DI / direct-vm)", "and Http (HTTP endpoint mounting) read this same section — one declaration", "drives both modules. Toggle here, never in IdentityTransport:Features below." ], "Features": { "EnableScim": true, "EnableScimBulk": true, "EnableFederation": true, "EnableDynamicRegistration": true, "EnablePushedAuthorization": true, "EnableDeviceCodeFlow": true, "EnableJar": true }, "Jar": { "//": "Dev/conformance only: the request_uri is fetched from the suite or a demo HTTP listener on loopback, so private targets and plain http are allowed. PROD: remove this section (defaults refuse both).", "RequestUriAllowPrivateNetworkTargets": true, "RequestUriRequireHttps": false }, "BackchannelLogout": { "//": "Dev/demo only: demo_backchannel_logout registers a receiver on a loopback HTTP listener, so private targets and plain http are allowed. PROD: remove this section (defaults require https to a public address).", "AllowPrivateNetworkTargets": true, "RequireHttps": false }, "DynamicRegistrationAllowedGrantTypes": [ "authorization_code", "refresh_token", "password", "client_credentials", "urn:ietf:params:oauth:grant-type:device_code", "urn:ietf:params:oauth:grant-type:token-exchange" ], "//DynamicRegistrationAllowedScopesSecurity": [ "Widened to include every granular identity:: scope so the included", "demo suite can probe each admin surface independently.", "This list alone no longer opens anything: an administrative scope is refused unless the", "registration is authenticated (DynamicRegistrationInitialAccessToken, set below), and", "that rule lives in code — the list can widen policy for authenticated registrations, not", "hand administration to an anonymous caller. Which scopes count as administrative is", "Identity:AdminScopeEntitlement.", "Production hosts that do not register administrative clients dynamically should trim this", "list back to the user-info scopes (openid, profile, email, phone, address,", "offline_access, groups, roles, identity:account) and leave the token null.", "'identity:manage' (master) and 'identity:impersonate' remain excluded by default —", "those carry the highest blast radius (full admin / act-as-another-user)." ], "DynamicRegistrationAllowedScopes": [ "openid", "profile", "email", "phone", "address", "offline_access", "groups", "roles", "identity:account", "identity:read", "identity:users:read", "identity:users:write", "identity:groups:read", "identity:groups:write", "identity:consents:read", "identity:consents:write", "identity:mfa:read", "identity:mfa:write", "identity:applications:read", "identity:applications:write", "identity:scopes:read", "identity:scopes:write", "identity:roles:read", "identity:roles:write", "identity:claims:read", "identity:claims:write", "identity:federation:read", "identity:federation:write", "identity:webhooks:read", "identity:webhooks:write", "identity:signing-keys:read", "identity:signing-keys:write", "identity:sessions:read", "identity:sessions:write", "identity:tokens:read", "identity:tokens:write", "identity:audit:read", "scim" ], "//DynamicRegistrationInitialAccessToken": [ "RFC 7591 §1.2 protected registration. Two modes, and the difference is the whole point:", " set — POST /connect/register requires this bearer for every registration, and the", " allow-list below governs what those authenticated registrations may ask for;", " null — registration is open, and an open registration can never obtain an", " administrative scope, whatever the allow-list says. That floor is in code", " (DynamicRegistrationProcessor), so no configuration mistake can hand", " administration to an anonymous caller.", "The value below is a DEV CREDENTIAL, shipped for the same reason the seeded admin", "password and the dev pepper above are: the demo suite registers clients carrying granular", "admin scopes, and this is what authorises it. It is as public as this file.", "PRODUCTION: rotate it (or set it to null and trim DynamicRegistrationAllowedScopes to the", "user-info scopes). Generate: [Convert]::ToBase64String((1..32 | %{Get-Random -Max 256})).", "Supply via L5 Override env-var:", " Tsak__Contexts__identity.core__Override__Identity__DynamicRegistrationInitialAccessToken=" ], "DynamicRegistrationInitialAccessToken": "dev-only-initial-access-token-not-for-production", "DeviceCodeLifetime": "00:10:00", "DeviceCodePollingInterval": 5, "RequirePushedAuthorizationRequests": false, "PushedAuthorizationRequestLifetime": "00:01:30", "Dpop": { "Enabled": true, "RequireForAccessTokens": false, "AllowedSigningAlgorithms": [ "ES256", "ES384", "PS256", "RS256" ], "IatToleranceSeconds": 60, "RequireNonce": false, "ReplayStore": { "Backend": "memory", "MemorySweepInterval": "00:01:00" } }, "//WebAuthn": [ "MFA-3 (FIDO2 / Passkeys). When Enabled=true the self-service /me/webauthn route", "and the MFA assert route are exposed. RpId and Origins are CRYPTO-BOUND to every", "registered credential \u2014 changing them after registrations breaks all keys.", "Dev defaults below match the BFF on https://localhost:7000." ], "WebAuthn": { "Enabled": true, "RpId": "localhost", "RpName": "redb.Identity (dev)", "Origins": [ "https://localhost:7000", "http://localhost:5000" ], "TimeoutMs": 60000, "ChallengeTtlSeconds": 300, "UserVerification": "preferred", "Attestation": "none", "UseFidoMetadataService": false, "AaguidBlocklist": null, "ChallengeCleanupInterval": "01:00:00" }, "Ldap": { "//": [ "Variant B integration — opt-in. When Enabled=true, each entry in Providers[]", "is registered as an IExternalUserProvider in the Identity child SP.", "BindPassword is a SECRET — supply via L5 Override:", " Tsak__Contexts__identity.core__Override__Identity__Ldap__Providers__0__BindPassword=", "Presets: OpenLDAP (UserFilter '(uid={0})') | ActiveDirectory ('(&(objectClass=user)(sAMAccountName={0}))').", "Multiple providers tried in Priority order (lower = first). Domains[] routes", "user@example.com / EXAMPLE\\user to a specific provider." ], "Enabled": false, "Providers": [ { "//": "OpenLDAP example — REMOVE or REPLACE before enabling.", "ProviderName": "ldap-corp", "Priority": 100, "Server": "REPLACE_ME.example.com", "Port": 389, "UseSsl": false, "UseStartTls": true, "SkipCertificateValidation": false, "BindDn": "cn=svc-identity,ou=service-accounts,dc=example,dc=com", "BindPassword": null, "OperationTimeoutSeconds": 10, "ConnectTimeoutSeconds": 10, "MaxConnections": 5, "UserBaseDn": "ou=users,dc=example,dc=com", "UserFilter": "(uid={0})", "SearchScope": "Subtree", "Domains": [ "example.com" ], "CheckAccountStatus": false, "AttributeMap": { "externalId": "uid", "displayName": "cn", "email": "mail", "phone": "telephoneNumber", "givenName": "givenName", "familyName": "sn" }, "AdditionalClaimsMap": { "department": "departmentNumber", "title": "title" } }, { "//": "Active Directory (LDAPS) example — REMOVE or REPLACE before enabling. CheckAccountStatus reads userAccountControl bits.", "ProviderName": "ad-internal", "Priority": 200, "Server": "dc01.corp.local", "Port": 636, "UseSsl": true, "UseStartTls": false, "SkipCertificateValidation": false, "BindDn": "CN=svc-identity,OU=Service Accounts,DC=corp,DC=local", "BindPassword": null, "OperationTimeoutSeconds": 10, "ConnectTimeoutSeconds": 10, "MaxConnections": 5, "UserBaseDn": "OU=Users,DC=corp,DC=local", "UserFilter": "(&(objectClass=user)(sAMAccountName={0}))", "SearchScope": "Subtree", "Domains": [ "corp.local", "CORP" ], "CheckAccountStatus": true, "AttributeMap": { "externalId": "sAMAccountName", "displayName": "displayName", "email": "mail", "phone": "telephoneNumber", "givenName": "givenName", "familyName": "sn" }, "AdditionalClaimsMap": { "department": "department", "title": "title", "upn": "userPrincipalName" } } ] }, "EnablePasswordFlow": true, "EnableTokenExchange": true, "TokenExchangeAllowImpersonation": false, "TokenExchangeMaxDelegationDepth": 5, "LoginPath": "/login", "ConsentPath": "/consent", "MfaPath": "/mfa", "MfaRecoveryPath": "/mfa/recovery", "OtpCooldown": "00:01:00", "OtpMaxPerHour": 5, "MfaLockoutClockSkew": "00:00:05", "//RecoveryCodePepper": [ "SECRET. Generate (PowerShell): [Convert]::ToBase64String((1..32 | %{Get-Random -Max 256})).", "Supply via L5 Override env-var in production. NULL = MFA recovery codes disabled.", "Dev ships a fixed value because AllowEphemeralKeys=false is required for the props", "signing-key store (see UsePropsSigningKeyStore above), and with ephemeral disabled the", "in-code fallback path that generates a random pepper at startup is also disabled." ], "RecoveryCodePepper": "", "RecoveryCodePbkdf2Iterations": 600000, "//SeedBackchannelClient": [ "W6-0 — idempotent client_credentials service account used by the Web BFF", "to push/poll /api/v1/identity/revoked-sids (backchannel logout blacklist).", "Enabled=true: SeedBackchannelClientHostedService creates the OpenIddict", "application on startup if missing. ClientSecret is a SECRET — supply via", "L5 Override env-var (same value must be set for the Web BFF):", " Tsak__Contexts__identity.core__Override__Identity__SeedBackchannelClient__ClientSecret=", " Identity__BackchannelClient__ClientSecret= (set on the BFF process)", "Helper script: redb.Identity/scripts/dev-backchannel-secret.ps1 generates one secret and sets both env-vars.", "When ClientSecret is empty the seeder logs a warning and skips (a confidential client cannot be registered without a secret per RFC 6749 §4.4)." ], "SeedBackchannelClient": { "Enabled": true, "ClientId": "identity-backchannel", "ClientSecret": null, "DisplayName": "Identity Backchannel Service Account", "Scopes": [ "identity:manage" ] }, "LoginTitle": "Sign In", "LogoUrl": null, "PrimaryColor": "#2563eb", "PrimaryColorHover": "#1d4ed8", "CustomCss": null, "ScimScope": "scim", "//FederationProviders": [ "Each entry is registered as an upstream OIDC IdP (login button on /login).", "ClientSecret is a SECRET — supply via L5 Override:", " Tsak__Contexts__identity.core__Override__Identity__FederationProviders__0__ClientSecret=", "AutoProvision=true creates redb users on first successful login. Priority orders the buttons (lower = first)." ], "FederationProviders": [ { "//": "Google OIDC — REMOVE or REPLACE before enabling.", "ProviderId": "google", "DisplayName": "Google", "Authority": "https://accounts.google.com", "ClientId": "REPLACE_ME", "ClientSecret": "", "Scopes": [ "openid", "profile", "email" ], "AutoProvision": true, "Priority": 100 }, { "//": "Microsoft Entra ID (Azure AD) — multi-tenant. For single-tenant use https://login.microsoftonline.com//v2.0.", "ProviderId": "microsoft", "DisplayName": "Microsoft", "Authority": "https://login.microsoftonline.com/common/v2.0", "ClientId": "REPLACE_ME", "ClientSecret": "", "Scopes": [ "openid", "profile", "email" ], "AutoProvision": true, "Priority": 200 }, { "//": "Keycloak — replace {host}/{realm}. Self-hosted IdP, useful for testing or B2B federation.", "ProviderId": "keycloak", "DisplayName": "Keycloak", "Authority": "https://REPLACE_ME.example.com/realms/REPLACE_ME", "ClientId": "REPLACE_ME", "ClientSecret": "", "Scopes": [ "openid", "profile", "email" ], "AutoProvision": true, "Priority": 300 }, { "//": "GitHub OAuth2 (NOT full OIDC — userinfo via /user). Authority points at the OIDC bridge endpoint.", "ProviderId": "github", "DisplayName": "GitHub", "Authority": "https://github.com", "ClientId": "REPLACE_ME", "ClientSecret": "", "Scopes": [ "read:user", "user:email" ], "AutoProvision": true, "Priority": 400 }, { "//": "Mock OIDC IdP for demo_federation_e2e. Points at navikt/mock-oauth2-server running on the dev rinat-net docker network. Accepts any clientId/clientSecret. REMOVE for production deployments.", "ProviderId": "mock-idp-e2e", "DisplayName": "Mock IdP (e2e)", "Authority": "http://127.0.0.1:9199/default", "ClientId": "fed-e2e-client", "ClientSecret": "", "Scopes": [ "openid", "profile", "email" ], "AutoProvision": true, "Priority": 999 }, { "//": "Mock GitHub OAuth2 IdP for demo_federation_github. The demo itself starts a tiny pwsh HttpListener on port 9201 that emulates github.com's /login/oauth/authorize + /login/oauth/access_token + api.github.com's /user + /user/emails. REMOVE for production.", "ProviderId": "mock-github-e2e", "Kind": "github", "DisplayName": "Mock GitHub (e2e)", "Authority": "http://127.0.0.1:9201", "ClientId": "gh-e2e-client", "ClientSecret": "", "Scopes": [ "read:user", "user:email" ], "AutoProvision": true, "Priority": 1000, "Endpoints": { "AuthorizeEndpoint": "http://127.0.0.1:9201/login/oauth/authorize", "TokenEndpoint": "http://127.0.0.1:9201/login/oauth/access_token", "UserEndpoint": "http://127.0.0.1:9201/user", "EmailsEndpoint": "http://127.0.0.1:9201/user/emails" } } ], "ReverseProxies": { "//": [ "Secure-by-default: TrustForwardedFor=false ignores X-Forwarded-For.", "Enable ONLY when behind a trusted proxy listed below.", " KnownProxies — exact IPv4/IPv6 of trusted proxies, e.g. ['10.0.0.1','203.0.113.7']", " KnownNetworks — CIDR ranges, e.g. ['10.0.0.0/8','192.168.0.0/16','fd00::/8']" ], "TrustForwardedFor": false, "KnownProxies": [], "KnownNetworks": [] }, "RateLimit": { "//": [ "C1: per-IP and per-(IP+username) throttling on /connect/token and /login.", "Backend 'memory' = per-process (single-node only — counters are NOT shared).", "Backend 'redis' = cluster-wide. REQUIRED behind multiple instances or LB.", "Redis examples (supply via L5 Override — connection string is a SECRET):", " single : redis://localhost:6379,abortConnect=false", " pwd+db : redis://:password@redis.internal:6379,defaultDatabase=2,abortConnect=false", " cluster : redis-1:6379,redis-2:6379,redis-3:6379,password=", " sentinel: redis-sent-1:26379,redis-sent-2:26379,serviceName=mymaster" ], "Enabled": false, "PerIpPerMinute": 30, "PerIpUsernameFailures": 5, "PerIpUsernameWindow": "00:15:00", "DefaultRetryAfterSeconds": 60, "Backend": "memory", "RedisConnectionString": null, "RedisKeyPrefix": "redb:identity:rl:" }, "Validation": { "//": [ "Server-side input-length limits. Regex overrides: leave null for source-generated defaults.", "Password length/policy lives in 'PasswordPolicy' below." ], "MaxIdentifierLength": 128, "MaxDisplayNameLength": 256, "MaxDescriptionLength": 1024, "MinPasswordLength": 8, "MaxPasswordLength": 512, "IdentifierPattern": null, "//IdentifierPatternDefault": "^[a-zA-Z0-9\\-_.]+$", "EmailPattern": null, "//EmailPatternDefault": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$", "PhonePattern": null, "//PhonePatternDefault": "^\\+[1-9]\\d{1,14}$" }, "PasswordPolicy": { "//": [ "H10 — server-side password policy applied by user create/change/SCIM endpoints.", "Defaults are STRICT (NIST SP 800-63B / OWASP ASVS 4.0.3 §2.1).", "HistoryCount=0 disables history; MaxAge='00:00:00' disables expiration.", "BreachCheckEnabled=true requires a registered IPasswordBreachChecker." ], "MinLength": 12, "MaxLength": 512, "RequireDigit": true, "RequireUppercase": true, "RequireLowercase": true, "RequireSpecial": false, "SpecialChars": "!@#$%^&*()-_=+[]{}|;:,.<>?/`~\"'\\\\", "HistoryCount": 5, "MaxAge": "90.00:00:00", "BreachCheckEnabled": false }, "Registration": { "//": [ "N-3 (N3-7) — public self-service account registration. Binds", "direct-vm://identity-account-register and POST /api/v1/identity/account/register.", "ON here on purpose: this context is the showcase one, and an image where a visitor", "can create an account and walk the sign-in, MFA and self-service flows is the point.", "The code default is false — a host that does not set this ships closed.", "What makes it safe to leave open: since 2026-09-21 an administrative scope reaches a", "user only through a role that carries it (RestrictAdminScopesByRoleHandler), so a", "self-registered account holds openid/profile/identity:account and nothing that can", "administer. Before that gate existed, registration was the path from anonymous to full", "administrator in two requests, and it was shipped closed for exactly that reason.", "PRODUCTION: set false unless public sign-up is a feature you want. And note this is", "not the only anonymous door — see DynamicRegistrationAllowedScopes above, which still", "lets any caller mint a client_credentials client carrying granular admin scopes.", "E-mail: registration itself does not touch SMTP. The verify link is sent afterwards by", "the BFF (/api/auth/account/verify-email/send), and an unverified account can sign in,", "so with no reachable relay the account still works — only the letter never arrives." ], "Enabled": true, "SendVerifyEmail": true, "RequireUniqueEmail": true }, "Smtp": { "//": [ "N-4 (Session C) — SMTP transport for password-recovery / verify-email / change-email.", "Dev defaults point at the GreenMail container (route-greenmail) running on the host:", " SMTP 3025 (no auth), REST API on 8080 — used by demos to fetch captured mail.", "Production hosts MUST replace Host/Port with a real relay and set Security=StartTls or Ssl", "with valid credentials. Leave Enabled=false to keep SMTP route + channel unregistered." ], "Enabled": true, "Host": "127.0.0.1", "Port": 3025, "Security": "None", "Username": null, "Password": null, "FromAddress": "noreply@redb.local", "SkipCertificateValidation": false }, "FederationState": { "//": [ "C6 — encrypted federation 'state' parameter hardening.", "Backend 'memory' is per-process; use 'redis' behind multiple instances.", "RedisConnectionString falls back to RateLimit.RedisConnectionString when null", "(set ONE Redis target and both subsystems share it). See RateLimit above for", "connection-string examples." ], "StateMaxAge": "00:05:00", "RequireOneTimeUse": true, "RequireBrowserBinding": false, "BindingCookieName": "redb_fed_b", "Backend": "memory", "RedisConnectionString": null, "RedisKeyPrefix": "redb:identity:fed:nonce:" } } }, "//identity.http": [ "Read by the HTTP facade (IdentityHttpModuleHost + IdentityTransportOptions binder).", "IdentityTransport:* keys live here. Core (identity.core) ignores this section." ], "identity.http": { "IdentityTransport": { "Issuer": "https://host.docker.internal:5002", "//IssuerNote": "Mirror of Identity:Issuer (identity.core context). Tsak isolates context property buckets, so the HTTP facade can't read identity.core's Identity:Issuer directly. Drives discovery URLs + cookie Secure flag (https => Secure).", "Http": { "//": [ "Host — bind address of both ports. Default 0.0.0.0 (every interface);", " 127.0.0.1 keeps them on the loopback behind a local proxy.", "PublicPort — OIDC protocol + discovery (token, userinfo, .well-known/*).", " DEFAULT 5002 chosen to avoid the busy 8080 family (Docker friendly).", " Must match redb.Identity.Web appsettings.json -> Identity:Authority.", "ManagementPort — admin API (/api/v1/identity/*, /scim/*). Null = share PublicPort.", " PROD: separate firewalled port, e.g. 5003.", "CorsEnabled — required for SPA / native PKCE clients calling token from browser.", "CorsRegisteredClientOriginsEnabled — auto-allow origins matching registered client URIs.", "AdditionalAllowedOrigins — CSV fallback origins. NEVER '*'." ], "PublicPort": 5002, "//ManagementPort": "PROD: separate firewalled port, e.g. 5003. Null = share PublicPort (DEV only).", "ManagementPort": null, "//Ssl": [ "Serve the facade over HTTPS natively (Kestrel, via the redb.Route.Http connector).", "When true, SslCertPath MUST point to a PFX and Issuer (both identity.core + identity.http)", "MUST use the matching https URL so discovery, iss claims and the Secure cookie flag are", "emitted correctly. These values are currently set for the LOCAL OpenID conformance suite,", "which runs in Docker and reaches the OP at https://host.docker.internal:5002.", "For plain non-Docker dev, set Ssl=false and Issuer back to http://127.0.0.1:5002.", "SslCertPassword is a SECRET in production — supply via an L5 Override env-var:", " Tsak__Contexts__identity.http__Override__IdentityTransport__Http__SslCertPassword=" ], "Ssl": true, "SslCertPath": "C:/Work/yaml/conformance/certs/redb-identity-dev.pfx", "SslCertPassword": "", "CorsEnabled": false, "CorsRegisteredClientOriginsEnabled": true, "//AdditionalAllowedOrigins": "CSV without trailing slash. Example: 'https://app.dev.local,https://staging.example.com'. NEVER '*'.", "AdditionalAllowedOrigins": null, "FederationCallbackPath": "/connect/federation/callback" }, "Features": { "EnableScim": true, "EnableScimBulk": true, "EnableFederation": true, "EnableDynamicRegistration": true, "EnablePushedAuthorization": true, "EnableDeviceCodeFlow": true, "EnableJar": true }, "Jar": { "//": "Dev/conformance only: the request_uri is fetched from the suite or a demo HTTP listener on loopback, so private targets and plain http are allowed. PROD: remove this section (defaults refuse both).", "RequestUriAllowPrivateNetworkTargets": true, "RequestUriRequireHttps": false }, "//Features": "Mirror of Identity:Features (identity.core context). Tsak isolates context property buckets, so the HTTP facade can't read identity.core's Identity:Features directly — keep this list in sync.", "//FederationProviders": "Mirror of Identity:FederationProviders (identity.core context). Tsak isolates context property buckets, so the HTTP facade can't read identity.core's list directly. The /api/v1/identity/federation-providers/public endpoint and the /login page renderer read from this copy. Keep it in sync with the Core list. ClientSecret is unused by the HTTP facade (login redirects only need ClientId + Authority + Scopes); prod deployments may safely set ClientSecret to empty string here.", "FederationProviders": [ { "ProviderId": "google", "DisplayName": "Google", "Authority": "https://accounts.google.com", "ClientId": "REPLACE_ME", "ClientSecret": "", "Scopes": [ "openid", "profile", "email" ], "AutoProvision": true, "Priority": 100 }, { "ProviderId": "microsoft", "DisplayName": "Microsoft", "Authority": "https://login.microsoftonline.com/common/v2.0", "ClientId": "REPLACE_ME", "ClientSecret": "", "Scopes": [ "openid", "profile", "email" ], "AutoProvision": true, "Priority": 200 }, { "ProviderId": "keycloak", "DisplayName": "Keycloak", "Authority": "https://REPLACE_ME.example.com/realms/REPLACE_ME", "ClientId": "REPLACE_ME", "ClientSecret": "", "Scopes": [ "openid", "profile", "email" ], "AutoProvision": true, "Priority": 300 }, { "ProviderId": "github", "DisplayName": "GitHub", "Authority": "https://github.com", "ClientId": "REPLACE_ME", "ClientSecret": "", "Scopes": [ "read:user", "user:email" ], "AutoProvision": true, "Priority": 400 }, { "//": "Mock OIDC IdP for demo_federation_e2e — mirror of identity.core entry.", "ProviderId": "mock-idp-e2e", "DisplayName": "Mock IdP (e2e)", "Authority": "http://127.0.0.1:9199/default", "ClientId": "fed-e2e-client", "ClientSecret": "", "Scopes": [ "openid", "profile", "email" ], "AutoProvision": true, "Priority": 999 }, { "//": "Mock GitHub OAuth2 IdP for demo_federation_github — mirror of identity.core entry.", "ProviderId": "mock-github-e2e", "Kind": "github", "DisplayName": "Mock GitHub (e2e)", "Authority": "http://127.0.0.1:9201", "ClientId": "gh-e2e-client", "ClientSecret": "", "Scopes": [ "read:user", "user:email" ], "AutoProvision": true, "Priority": 1000 } ] } }, "//identity.grpc": [ "Read by the gRPC facade (IdentityGrpcModuleHost + IdentityGrpcTransportOptions binder).", "Same IdentityTransport:* root as the HTTP facade, different sub-section — one section per", "transport, so operators configure both facades the same way. Core (identity.core) ignores it.", "Scope: the service-to-service subset (token, introspect, revoke, userinfo, discovery, jwks).", "Browser flows and DPoP stay on HTTP by design — see doc/gRPC/README.md." ], "identity.grpc": { "IdentityTransport": { "Grpc": { "//": [ "Host — bind address. 0.0.0.0 to accept from outside the machine.", "PublicPort — protocol surface. NEVER share a port with the HTTP facade: gRPC needs", " HTTP/2 while HTTP serves HTTP/1.1+2, and one Kestrel listener has a", " single protocol set. The shared host throws on that conflict.", "ManagementPort — admin surface. Null = share PublicPort (DEV). PROD: separate firewalled", " port — different consumers, different blast radius.", "Compression — None | Gzip. Inbound gzip is always accepted regardless.", "Health — serve grpc.health.v1.Health/Check for k8s / Consul / Envoy probes.", "EmitHttpCompatHeaders — mirror the client IP into redbHttp.RemoteAddress so Core's per-IP", " throttle and brute-force lockout work behind this facade. Leave ON:", " those protections silently no-op when the header is missing." ], "Host": "0.0.0.0", "PublicPort": 5011, "//ManagementPort": "PROD: separate firewalled port, e.g. 5012. Null = share PublicPort (DEV only).", "ManagementPort": null, "//Ssl": [ "TLS for the gRPC listener. SslCertPassword is a SECRET in production — supply via an L5", "Override env-var:", " Tsak__Contexts__identity.grpc__Override__IdentityTransport__Grpc__SslCertPassword=" ], "Ssl": false, "SslCertPath": null, "SslCertPassword": null, "//ClientCertificateMode": [ "mTLS: NoCertificate | AllowCertificate | RequireCertificate. Requires Ssl=true.", "OFF by default so deployments without a client-certificate PKI are not blocked.", "RECOMMENDED for the management port in production.", "AllowedClientThumbprints — CSV of SHA-1 thumbprints; when set, a certificate outside the", "list is rejected even if its chain validates." ], "ClientCertificateMode": "NoCertificate", "AllowedClientThumbprints": null, "Compression": "None", "MaxMessageSize": 4194304, "Health": true, "EmitHttpCompatHeaders": true } } }, "//identity.soap": [ "Read by the WS-Trust facade (IdentitySoapModuleHost + IdentitySoapTransportOptions binder).", "Same IdentityTransport:* root as the other facades, different sub-section. Core ignores it.", "Scope: Issue, Validate, Cancel, Renew — the service-to-service subset, as on gRPC.", "Browser flows and DPoP stay on HTTP by design — see doc/SOAP/README.md.", "One address serves all four operations: WS-Trust distinguishes them by the WS-Addressing", "Action, which is what generated clients emit." ], "identity.soap": { "IdentityTransport": { "Soap": { "//": [ "Host — bind address. 0.0.0.0 to accept from outside the machine.", "Port — separate from the HTTP facade by default. SOAP is ordinary HTTP/1.1 and could", " technically share a host; a separate port buys something else — WS-Trust can be", " closed off from the internet while plain OIDC stays open, with its own limits", " and its own suspend switch.", "Path — where the STS answers. GET on the same path serves the WSDL.", "Wsdl — publish the contract on GET. Leave ON: this facade's audience builds clients", " with generators, and a generator needs a document to read.", "EmitHttpCompatHeaders — mirror the client IP into redbHttp.RemoteAddress so Core's per-IP", " throttle and brute-force lockout work behind this facade. Leave ON: those", " protections silently no-op when the header is missing." ], "Host": "0.0.0.0", "Port": 5021, "Path": "/sts", "//Ssl": [ "TLS is MANDATORY here, unlike the other facades, and its absence is a refusal to start", "rather than a warning: WS-Security UsernameToken carries the client secret in CLEAR TEXT.", "SslCertPassword is a SECRET in production — supply via an L5 Override env-var:", " Tsak__Contexts__identity.soap__Override__IdentityTransport__Soap__SslCertPassword=", "AllowPlaintext is the single escape hatch, for a connection already terminated by a trusted", "proxy. Setting it is the operator's statement that the wire is protected some other way;", "with Ssl=false and AllowPlaintext=false the facade refuses to start." ], "//DEV-DEFAULT": [ "Ssl=false + AllowPlaintext=true is a DEVELOPMENT value, and it is spelled out rather than", "hidden: it is what lets the module come up on a dev worker that has no certificate.", "PRODUCTION: set Ssl=true with SslCertPath, and remove AllowPlaintext — or leave the", "connection to a proxy that terminates TLS and keep AllowPlaintext as the statement that", "someone else protects the wire. With Ssl=false and AllowPlaintext=false the facade refuses", "to start, which is the intended behaviour and not a fault to work around." ], "Ssl": false, "SslCertPath": null, "SslCertPassword": null, "AllowPlaintext": true, "//ClientCertificateMode": [ "mTLS: NoCertificate | AllowCertificate | RequireCertificate. Requires Ssl=true.", "OFF by default so deployments without a client-certificate PKI are not blocked.", "RECOMMENDED for an STS in a closed contour — WS-Trust callers are known partners.", "AllowedClientThumbprints — CSV of SHA-1 thumbprints; when set, a certificate outside the", "list is rejected even if its chain validates.", "An unrecognised value here is refused at start rather than read as NoCertificate: a typo", "must not turn mTLS off on an endpoint whose operator believes it is on." ], "ClientCertificateMode": "NoCertificate", "AllowedClientThumbprints": null, "Wsdl": true, "EmitHttpCompatHeaders": true } } } } }