Path: redb-identity/src/redb.Identity.Management/Controllers/PasswordRecoveryController.cs 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/src/redb.Identity.Management/Controllers/PasswordRecoveryController.cs ---- using redb.Identity.Contracts.Routes; using redb.Identity.Contracts.Users; using redb.Route.Controllers.Attributes; namespace redb.Identity.Management.Controllers; /// /// N-4 (Session C): anonymous password-recovery HTTP facade. /// /// POST /api/v1/identity/password/forgot — initiate recovery. /// Anti-enumeration: always 200 success, even when the e-mail does not match a user /// or the callerResetUrl is not whitelisted on the client. /// POST /api/v1/identity/password/reset — complete recovery by verifying /// the single-use token and setting the new password (revokes all sessions). /// /// Both endpoints require NO bearer token — they are reachable by any unauthenticated /// browser / SDK caller. Brute-force enumeration is mitigated by the per-IP throttle /// processor sitting in front of both direct-vm routes (configured in /// IdentityCoreRouteBuilder). /// [Route("password")] public class PasswordRecoveryController : IdentityControllerBase { /// /// Initiate password recovery for the supplied e-mail. Always returns /// { success = true } regardless of outcome to prevent account enumeration — /// the actual delivery decision is made server-side and recorded in the audit log. /// [HttpPost("forgot")] public async Task Forgot([FromBody] PasswordForgotRequest request) { return await Forward(IdentityEndpoints.PasswordForgot, "forgot", request); } /// /// Complete password recovery: verify + atomically consume the reset token, validate /// the new password against the policy, persist it, and revoke every active session. /// Failures return generic invalid_token regardless of the specific cause /// (bad / expired / consumed token, unknown user) — granular reason lives only in /// audit logs to deny attackers useful guessing signal. /// [HttpPost("reset")] public async Task Reset([FromBody] PasswordResetRequest request) { return await Forward(IdentityEndpoints.PasswordReset, "reset", request); } }