Deprecated OAuth Flow
OAuth Implicit Grant (response_type=token)
warningSecurity
deprecated-oauth-flowWhy this matters
The Implicit Grant exposes access tokens in the URL fragment, making them visible in browser history, referrer headers, and server logs. It's been deprecated by OAuth 2.1.
Example
lib/oauth.tsconst authUrl = `https://auth.example.com/authorize
?response_type=token
&client_id=${CLIENT_ID}
&redirect_uri=${REDIRECT_URI}`;lib/oauth.tsconst authUrl = `https://auth.example.com/authorize
?response_type=code
&client_id=${CLIENT_ID}
&redirect_uri=${REDIRECT_URI}
&code_challenge=${challenge}
&code_challenge_method=S256`;How to fix
Use the Authorization Code flow with PKCE instead of the Implicit Grant. This keeps tokens out of the URL and is the recommended approach for all OAuth clients.
Reference
- In the output
- Findings carry
"ruleId": "deprecated-oauth-flow"in--jsonand the same id in SARIF and in the terminal. - Silence one line
// prodlint-disable-next-line deprecated-oauth-flow- Silence a whole file
// prodlint-disable deprecated-oauth-flowat the top of the file- How it works
- Matches text patterns. Source on GitHub