Rate Limiting Configuration
Protect your IdentitySuite instance from abuse and excessive API usage with comprehensive rate limiting policies and monitoring
Rate Limiting Configuration
Rate limiting protects IdentitySuite from abuse and excessive API usage by controlling the number of requests clients can make within specific time windows. All rate limiting policies use SlidingWindowRateLimiterOptions to provide flexible and granular control over request throttling.
Requests are classified by OpenIddict's endpoint type, not by URL path - so the correct policy still applies even if an endpoint has been remapped to a non-default path.
Rejected Request Behavior:
Every policy above returns HTTP 429 Too Many Requests when a client exceeds its limit - including the Configuration, JsonWebKeySet and PushedAuthorization endpoints, where OpenIddict's default OAuth error mapping would otherwise surface a plain 400. Identity Endpoints (Account pages) return the same 429 even though they never go through the OAuth error pipeline at all.
SlidingWindowRateLimiterOptions
used by every policy above does not currently report a retry time on a rejected request - a known limitation of the
underlying .NET rate limiter itself, not something withheld by IdentitySuite. Clients that build automatic retry/backoff
on top of these endpoints should not assume this header will be present and should fall back to their own backoff
strategy.
Rate Limiting Controls:
identitySuiteSettings.*.json is
copied into your project once when the package is first added and is never overwritten by later package updates, so an
existing installation keeps whatever value it already has until you change it yourself here or directly in the JSON file.
OIDC Critical Endpoints (High-Risk):
High-risk OIDC endpoints vulnerable to abuse through automated attacks and resource exhaustion.
These endpoints handle authentication flows and token generation, making them prime targets for brute force and DoS attacks.
Partitioned by client IP.
Endpoint types: Authorization, PushedAuthorization, UserInfo, DeviceAuthorization, and Token requests without a
client_id.
SlidingWindowRateLimiterOptions Parameters:
OIDC Default Endpoints (Moderate-Risk):
Standard OIDC endpoints with moderate risk exposure. These endpoints handle session termination and token introspection,
requiring protection against automated scraping and session abuse attacks. Partitioned by client IP.
Endpoint types: EndSession, EndUserVerification, Revocation, and Introspection requests without a
client_id.
SlidingWindowRateLimiterOptions Parameters:
OIDC Client Endpoints (Partitioned by Client):
Token and Introspection requests that carry a client_id are partitioned by client instead of by IP. This protects
a legitimate high-volume client (e.g. a backend service issuing client-credentials or refresh-token requests) from being
penalized just because other clients share the same IP address, while still limiting each client individually.
Endpoint types: Token, Introspection (only when a client_id is present).
SlidingWindowRateLimiterOptions Parameters:
Global Endpoints (Baseline Protection):
Fallback policy for OIDC endpoint types not covered by a more specific policy - in practice mainly Configuration
(discovery) and JsonWebKeySet (JWKS), which expose only public, cacheable metadata, so this permissive baseline is a
deliberate choice rather than a gap.
Scope: only within the OIDC pipeline. Plain application pages are out of reach for this policy by
construction - OpenIddict's ProcessRequestContext fires for every request that reaches its ASP.NET Core
middleware, but it can only build a rejection response for endpoint types it recognizes; calling Reject()
for an unrecognized (Unknown) endpoint throws instead of returning a response. The handler therefore skips
enforcement entirely for Unknown endpoint types - see Identity Endpoints below for rate limiting plain
application pages instead.
SlidingWindowRateLimiterOptions Parameters:
Identity Endpoints (Account Pages, Partitioned by IP):
Unlike every other policy above, this one is enforced by a plain ASP.NET Core middleware, not an OpenIddict handler - it
protects POST requests to the Account pages (login, register, 2FA, forgot/reset password, and the self-service pages under
Account/Manage such as change password/email), which never go through the OIDC pipeline. ASP.NET Identity's own account
lockout already protects a single account from brute force; it does not stop password spraying (many accounts, few
passwords, no single account ever reaches its lockout threshold), user enumeration via register/forgot-password, or
registration/email flooding - this policy fills that gap by limiting per source IP. Only POST requests under
/Account/ are limited; GET requests (page rendering) never are, and the admin panel under /Manage/
is a separate, already-authenticated area out of scope for this policy.
SlidingWindowRateLimiterOptions Parameters:
IP Address Management:
White Listed IPs:
- • IP addresses exempt from all rate limiting
- • Trusted sources and administrative access
- • Add IP addresses that should never be throttled
Black Listed IPs:
- • IP addresses completely blocked from access
- • Known malicious sources and threat actors
- • Automatically reject all requests from these IPs
X-Forwarded-For/X-Forwarded-Proto headers are client-controlled and ignored unless a reverse proxy is
explicitly configured, see Reverse Proxy Configuration below. Without that configuration, an application
running behind a real reverse proxy will rate-limit and whitelist/blacklist by the proxy's own IP, not the client's.
1.1.1, 10/8) that some parsers accept as a
legacy shorthand are rejected, closing a known IP-filter bypass vector.
Reverse Proxy Configuration:
Disabled by default. Without an explicitly trusted proxy, the direct TCP connection's remote address is the only
source of the client IP that cannot be spoofed by the client - enabling this without a real reverse proxy in front
of the application would let any client forge its own X-Forwarded-For header and bypass rate limiting,
whitelisting, and blacklisting entirely.
X-Forwarded-For/X-Forwarded-Proto headers10.0.0.5)10.0.0.0/24)Understanding SlidingWindowRateLimiterOptions:
Rate Limiting Metrics and Monitoring:
RateLimiting:Metrics): raw per-request detail is capped by
MaxEntries (default 100,000 - oldest entries are dropped once exceeded) and kept for
RawRetention (default 1 day). The dashboard's 7-day view still shows accurate policy totals beyond that
window via long-term hourly aggregates, but per-client and per-endpoint breakdowns are only available for the raw
retention window. Without these bounds, the metrics store itself becomes a memory-exhaustion vector under sustained
traffic - Configuration/JsonWebKeySet requests are also only recorded when actually denied, since an allowed request
there is routine, high-volume noise.
Real-time Metrics:
- • Rejection Rate: Percentage of requests being blocked
- • Unique Clients: Number of distinct IP addresses
- • Active Policies: Currently enforced rate limit policies
- • Suspicious Clients: IPs showing potential abuse patterns
Analytics Views:
- • Statistics Policy: Per-policy performance data
- • Popular Endpoints: Most frequently accessed endpoints
- • Client Requests: Top requesting IP addresses
- • Time Trends: Request patterns over time
Configuration Guidelines:
- • Test rate limiting policies in a development environment first
- • Monitor metrics regularly to adjust limits based on actual usage patterns
- • Consider legitimate high-traffic scenarios when setting limits
- • White-list trusted IP addresses to prevent accidental blocking
- • Application restart required for configuration changes to take effect