Deploy this once and use it for all your Google Drive bots. No database required on the bridge side.
Create a JSON object with your internal user ID (u) and your bot's webhook URL (r).
{ "u": "user_123", "r": "https://mybot.com/api/tokens" }
Base64 encode this JSON string to use in the URL.
Send your user to this service's auth endpoint:
After the user signs in, this service will POST a JSON payload to your return_url:
{
"status": "success",
"user_id": "user_123",
"email": "user@gmail.com",
"credentials": {
"access_token": "ya29...",
"refresh_token": "1//...",
"expires_at": 1713600000.0
}
}
Generate tokens independently for testing or manual database entry.