Fix OAuth2 "too many redirects" and 403 errors
The fastest and most reliable fix. Works on Linux and macOS.
# Download, make executable, and run
curl -O https://nginx.ai-servicers.com/scripts/clearbrowser
chmod +x clearbrowser
./clearbrowser brave # Clear Brave (default)
./clearbrowser chrome # Clear Chrome
./clearbrowser firefox # Clear Firefox
./clearbrowser all # Clear all browsers
./clearbrowser --dry-run # Preview what would be deleted
The script automatically kills the browser, deletes cookie files, and cleans up backups.
If you can't run scripts, delete the files manually:
# 1. Close Brave completely
pkill -9 -f brave
# 2. Delete cookie files
rm ~/.config/BraveSoftware/Brave-Browser/Default/Cookies
rm ~/.config/BraveSoftware/Brave-Browser/Default/Cookies-journal
# 3. Open Brave and navigate to the service
# 1. Close Chrome completely
pkill -9 -f chrome
# 2. Delete cookie files
rm ~/.config/google-chrome/Default/Cookies
rm ~/.config/google-chrome/Default/Cookies-journal
# 3. Open Chrome and navigate to the service
# 1. Close Firefox completely
pkill -9 -f firefox
# 2. Delete cookie files (all profiles)
find ~/.mozilla/firefox -name "cookies.sqlite" -delete
# 3. Open Firefox and navigate to the service
# Brave
rm ~/Library/Application\ Support/BraveSoftware/Brave-Browser/Default/Cookies
# Chrome
rm ~/Library/Application\ Support/Google/Chrome/Default/Cookies
# Firefox
find ~/Library/Application\ Support/Firefox/Profiles -name "cookies.sqlite" -delete
Clears the OAuth2 session cookie for a service, then redirects you back so you get a fresh Keycloak login. Works on any device including phones.
If Quick Fix doesn't work, the service may have stale tokens in browser storage. Clear everything for a specific site:
brave://settings/content/all?searchSubpage=HOST. Paste in address bar, click the trash icon next to the site, then reload.
chrome://settings/content/all?searchSubpage=HOST. Paste in address bar, click the trash icon next to the site, then reload.
about:preferences#privacy. Paste in address bar, scroll to "Cookies and Site Data", click "Manage Data", search for the hostname, and remove it.
Sign out from individual services to clear their OAuth2 session cookies:
_oauth2_proxy cookie