An OAuth client secret / API key / password is assigned from a hard-coded string literal.
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
A secret shipped inside an APK is trivially recovered by decompiling the app, so a "confidential" client secret embedded in a mobile binary is effectively public (CWE-798). AI-generated Android samples inline the value to make the snippet compile and it ships in the release build.
A public mobile client should use PKCE and hold no client secret at all; any unavoidable key belongs in the build config or a secret store, not in source: val clientSecret = BuildConfig.CLIENT_SECRET // injected at build time val apiKey = System.getenv("API_KEY") and rotate any secret already committed.
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.kotlin.android.hardcoded-secret -- <reason>