Click + CREATE CREDENTIALS → OAuth client ID. Set up consent screen if prompted (External, add https://www.googleapis.com/auth/drive scope, add your email as test user).
Application type: Web application. Add redirect URI: http://localhost
Copy the Client ID and Client Secret below, then click Authorize.
After authorizing, your browser shows an error page — that's normal. Copy the full URL from the address bar and paste it below.
Paste the full URL from your browser address bar after Google redirects, or just the code= value.
Exchanging code…
Refresh token saved to the field below.
Already have a refresh token?
If you enter a refresh token here, the redirect URL above is ignored.