Getting started โ
oauthlint scans your code for the OAuth, OIDC and JWT mistakes that AI coding tools tend to write, and links every finding to a fix. This page takes you from zero to a clean CI in a few minutes.
Prerequisites โ
oauthlint runs on Semgrep, so you need it on the machine that runs the scan:
pipx install semgrep # or: brew install semgrepCheck your setup at any time:
npx oauthlint doctorYour first scan โ
No install required:
npx oauthlint scan ./srcEach finding shows the rule, the exact file and line, why it is dangerous, and a link to a page explaining the fix:
ERROR auth.jwt.alg-none (AUTH-JWT-001)
src/auth.ts:14
A forged token would pass: alg: none is allowed.
๐ https://oauthlint.dev/rules/jwt-alg-noneSeverity runs ERROR โ WARNING โ INFO. By default the scan reports everything and exits non-zero when it finds HIGH-impact issues.
Fail your CI on real problems โ
Pick the threshold that should break the build:
npx oauthlint scan ./src --fail-on HIGHOutput formats โ
npx oauthlint scan ./src --json # machine-readable
npx oauthlint scan ./src --format sarif > out.sarif # GitHub Code ScanningUpload the SARIF file with github/codeql-action/upload-sarif to see findings in the Security tab of your repo.
Auto-fix the safe ones โ
Some fixes are mechanical (for example, adding cookie flags). Apply them with:
npx oauthlint scan ./src --fixEverything else links to a documented fix you apply yourself.
Suppress a finding on purpose โ
Sometimes a finding is a deliberate, reviewed choice. Suppress a single line and say why:
// oauthlint-disable-next-line auth.jwt.alg-none -- legacy token, removed in Q2
return jwt.verify(token, key, { algorithms: ['RS256', 'none'] });Wholesale silencing of a whole file or rule is intentionally not supported: the next reviewer should see exactly which lines opted out, and why.
In your CI (GitHub Action) โ
The Action is Docker-based, so it runs whatever language your repo uses:
name: oauthlint
on: [pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Auspeo/oauthlint/action@v1
with:
severity: HIGH
fail-on: HIGHIn your editor (VS Code) โ
Install the oauthlint extension from the Marketplace for inline diagnostics as you type, with a Quick Fix to suppress a line.
Configuration โ
Generate a config file to tune severity, paths, and suppressions:
npx oauthlint initNext steps โ
- Browse the full rule catalogue.
- Found a false positive or want a new rule? See Contributing.