Namespace SEBT.Portal.Api.Middleware
Classes
- OidcOriginValidationMiddleware
validates the
Originheader on OIDC auth POST endpoints. Browsers setOriginautomatically on same-origin fetch POSTs; a missing or mismatched header indicates cross-origin replay or a non-browser client that we don't expect on these endpoints.Policy:
- POST to
/api/auth/oidc/*→ requireOriginmatches the configured portal origin. Reject with 403 if mismatched. - GET (config) → skip (idempotent, returns public info).
Refereris logged when mismatched but not enforced (privacy extensions strip it).
- POST to
- OtpRateLimitMiddleware
Middleware that extracts the email address from the OTP request body and stores it in HttpContext.Items for use by rate limiting partition key resolver.