An OIDC/JWT bearer handler disables HTTPS for its metadata and token exchange (RequireHttpsMetadata = false).
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
The discovery document, JWKS, and token traffic can then travel over plain HTTP, where an on-path attacker can swap signing keys or tokens and defeat the whole trust chain (CWE-319). This is a common AI-generated leftover from local development that ships to production.
Leave RequireHttpsMetadata at its secure default (true). If you truly need cleartext for local development only, guard it behind an environment check such as env.IsDevelopment() so production stays on HTTPS.
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
// oauthlint-disable-next-line auth.csharp.oauth.require-https-metadata-disabled -- <reason>