I have 3 email directions (in GSuite) for automatic send email, let's say:
Actually I use a Service Account with Domain-wide Delegation enable, and with Gmail API Scope: https://www.googleapis.com/auth/gmail.send
I use service account for upload documents to Drive.
My code works as expected, I can send emails with Gmail API with this auth code:
credentials = Google::Auth::ServiceAccountCredentials.make_creds(
json_key_io: f,
scope: g_scope
)
credentials.sub ='[email protected]'
credentials.fetch_access_token
My problem is that I want to restrict the users to only three. There is a way to select users for Service Account Delegation?