I know several people have had my problem, but I can’t find an answer to my question.
I created an automation for a client that has to send emails through his Gmail account. He created an app in Google Cloud Console and gave me access as an editor, so I set up all the necessary APIs.
I created the Gmail credentials using his cliend id but my Google account. Now, the send email node sends from my account.
A solution could be making him create the credentials. Is there another way?
I believe the correct way to approach this is to use a service account instead where you can then send on behalf of another account by impersonation. Using OAuth is going to link it to the account you auth as.
Google technically supports Service Accounts for use with Gmail, but it requires enabling domain-wide delegation, which Google discourages, and its behavior can be inconsistent.
n8n recommends using OAuth2 with the Gmail node.
I can’t provide a solution with inconsistent behavior to the client.
Yes, like with all things there will be warnings and recommendations, however if your use case absolutely needs to send on behalf of someone then it outweighs the recommendation, then i’d say it’s ok to use. Just make sure that your service accounts are kept safe.