DEV Community
•
2026-04-04 15:11
Building a Google OAuth CLI in Rust with PKCE (and surviving the borrow checker)
Building a Google OAuth CLI in Rust with PKCE
TL;DR: I built a tiny CLI that opens a Google login in your browser, receives the OAuth callback, exchanges the code using PKCE, and prints basic public profile info (email, name, picture). It took me about 5 hours in Rust, mainly because of ownership, String vs &str, and lifetime wrangling—but the result is a clean, secure local flow th...