Deprecated OAuth Flow

OAuth Implicit Grant (response_type=token)

warningSecuritydeprecated-oauth-flow

Why 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

Flaggedlib/oauth.ts
const authUrl = `https://auth.example.com/authorize
  ?response_type=token
  &client_id=${CLIENT_ID}
  &redirect_uri=${REDIRECT_URI}`;
Fixedlib/oauth.ts
const 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 --json and 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-flow at the top of the file
How it works
Matches text patterns. Source on GitHub