GSuite Activity Gmail API Service Account Authentication

Hi all.

I am trying to use the GSuite Package published by UiPath.
https://integrations.uipath.com/docs/gsuite-application-scope
I am trying to use the Service Account Key Authentication as the OAuth Authentication is not suitable for unattended workers. I am having issues with getting the service account to work with sending and receiving emails.

I have followed the steps to enable the gmail api and setup a service account, authorise domain wide authentication and download the json file.
Any help would be greatly appreciated!

Hi Nicholas,

The Gmail component works only if you authorise using OAuth2 as a service account is considered a role and is thus unable to send email. This is documented in the Gmail authentication section on Google’s website.

On the other hand, using the Domain wide Authentication checkbox does allow the service account the right to impersonate users, and thus send emails. Use this at your own caution.

To answer your question, you are going about the right way in doing this, but the configuration on Google’s side is not trivial. I made it when testing, and it involves being organisational admin.

More info here: https://developers.google.com/+/domains/authentication/delegation

You probably just forgot to enable the gmail scope or some such detail. It should work, let me know how it went!

2 Likes

Hi @Mihai_Dunareanu,

The issue is with IT giving access to domain wide authentication. The scope has been configured correctly otherwise, I am now just waiting on my IT team to give the proper access.

Thank you!

nicholas-san,

I would like to know further information on this matter.
I face the same problem.
After writing a topic like the link below in the UiPath Forum, I found your topic.

Please tell me what Roles you gave your service account in the GCP IAM settings.

Regards,
Akio

I did not understand you have Service Account Key or you want to use OAuth…

If you are using Service Account key, you need to have service account on gsuite. and then download json file and copy it to shared location.

then in drop down many choose Service key, fill only this 2 lines and it will work.

Cheers,
Radomir