I need my customers to forward me the emails received on their Gmail account from certain email addresses.
To avoid them to setup these rule manually, I was wondering to use Gmail APIs
to create a path where user just select the Gmail account and delegate us to setup the forwarding filter.
This works well, I can create/delete/list filters,
Problem arise when the forwarding email address is not already set, i.e. always:
To setup Forwarding address, domain-wide-delegation
is required, and here starts my problems:
first of all is the meaning of domain-wide-delegation
that makes me wonder:
domain would be gmail.com and clearly I'm not an admin of such domain
That means that what I'm trying to achieve it is not possible?
furthermore, I have another issue:
I created a Service Account
and I have the
Email
,
Key ID
,
Client ID
service_account.json
file with private key
and Domain Wide Delegation is set as Enabled
but I have not understood how to change the original routine in way of using Service Account instead of oAuth 2.0
I can imagine I have to change from using OAuth 2.0 Client IDs
to service account
Can someone explain how to use service account instead of oAuth?