Integration GMail Workspace with Custom SMTP Server using OAuth 2.0

Hello,
we had configure outbound email, using Custom SMTP Server integration.
Our customer uses Google Gmail as email platform on his company.
First we configured Basic Authentication, but to do that the customer had to configured Google Less Secure Apps, and it works fine. But our customer wants other option that does not need Google Less Secure Apps, due to secure resons.
We are trying to configure authentication with OAuth 2.0 and activate Gmail API, but without sucess.

Thanks,
Regards,

Rui Tomás

Our configuration:

Hi,

Looks like the OAuth2 token request is rejected. The error message tells you that this type of grant is not supported.
I could not find anything in Google doc on what grant types they do support. After some wider search on the net, I could find this article:

It seems that Google supports only authorization_code and refresh_token flows.

Custom SMTP server handles currently only the password grant type. We plan to support client_credentials grant type as well but it does not seem that will help. Those two grant types allow non interactive logins.

You may try also to test manually with a curl command for getting the OAuth token (or using any http tool):

Password grant:
curl -v -k -H "Content-Type: application/x-www-form-urlencoded"
-H "Authorization: Basic base64(app_id:app_secret)"
-X POST "https://oauth2.googleapis.com/token"
-d "grant_type=password&username=username&password=password&scope=your_scope"

If this works, then SMTP integration should work as well.

client_credentials grant:
curl -v -k -H "Content-Type: application/x-www-form-urlencoded"
-H "Authorization: Basic base64(app_id:app_secret)"
-X POST "https://oauth2.googleapis.com/token"
-d "grant_type=client_credentials&scope=your_scope"

I think you should open a ticket with Google to get confirmation of what precisely they do support or not.

Let us know.

Best regards,
V.P.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.