HIGH AI PREVALENCE: HIGH auth.py.oauth.hardcoded-client-secret
An OAuth client secret is passed as a string literal to the OAuth client.
Why AI tools produce this: AI coding tools generate this anti-pattern by default, it appears in a large share of AI-written auth code.
Why this matters
Committed to source control it is one search away from compromise, letting an attacker impersonate your application at the authorization server and exchange codes for tokens (CWE-798). AI-generated OAuth snippets inline the secret to make the example run.
Read it from the environment or a secret store instead, e.g. client_secret=os.environ["OAUTH_CLIENT_SECRET"].
VULNERABLE
SAFE
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.py.oauth.hardcoded-client-secret -- <reason>