Hello n8n Community,
I’m working on a workflow that involves triggering a Google OAuth consent screen for users and then using their Google credentials to impersonate them and interact with various Google services (like Google Sheets, Drive, etc.). Specifically, my use case is to:
- Use a Webhook as the trigger that prompts users to authenticate with Google.
- Redirect users to the Google OAuth consent screen so they can grant permissions.
- Once the user authorizes the app, retrieve their access token.
- Use this token to impersonate the user and perform actions on their behalf (such as reading from or writing to their Google Sheets).
However, I couldn’t find a built-in way to redirect users to the Google OAuth consent screen directly in the workflow (using something like a webhook or HTTP trigger). The closest I’ve gotten is the ability to set up OAuth credentials manually in n8n, but I’d like this process to be user-triggered so that each user connects their own Google account via OAuth.
Questions:
- Is there a way to dynamically trigger the Google OAuth consent screen via a webhook or similar trigger in n8n?
- How can I capture the OAuth token from the user’s Google login and store it in n8n for use in further nodes like Google Sheets or Drive?
- Can the Google OAuth credentials be linked dynamically to users, so that each user’s actions in the workflow are authenticated as them?
I’m looking for a way to automate this entire process—starting from the webhook trigger, redirecting the user to the Google login, and using their credentials dynamically.
Thanks for any insights or guidance!