OAuth2 Token Storage Issue in Make – Gmail API (401 Unauthorized)

Hello everyone,

I am developing a custom module for the Gmail API in Make, and I am facing an issue with OAuth2 token storage. I followed the official documentation, and the process seems to work correctly:

:white_check_mark: Initial authentication works – I can retrieve the accessToken and refreshToken manually via Postman.

:white_check_mark: OAuth authorization is successful– The Google sign-in window opens, and I can select my Gmail account.

:white_check_mark: Tokens are received in the response – access_token, refresh_token, and expires_in are present.

:cross_mark: Make does not seem to store the access token– When I try to call the Gmail API after authentication, I get a 401 Unauthorized error.

What I Have Tested and Observed

  1. Postman Test – If I manually insert my accessToken, the request works.

  2. Logging {{connection.accessToken}} – It appears empty when calling the Gmail API.

  3. Refresh Token Handling – It does not seem to be executed automatically in Make.

{
“authorize”: {
“url”: “Sign in - Google Accounts”,
“qs”: {
“scope”: “{{join(oauth.scope, ’ ')}}”,
“client_id”: “{{ifempty(parameters.clientId, common.clientId)}}”,
“redirect_uri”: “{{oauth.localRedirectUri}}”,
“response_type”: “code”,
“access_type”: “offline”,
“prompt”: “consent”
},
“response”: {
“temp”: {
“code”: “{{query.code}}”
}
}
},

“token”: {
“condition”: “{{temp.code}}”,
“url”: “https://oauth2.googleapis.com/token”,
“method”: “POST”,
“body”: {
“code”: “{{temp.code}}”,
“client_id”: “{{ifempty(parameters.clientId, common.clientId)}}”,
“client_secret”: “{{ifempty(parameters.clientSecret, common.clientSecret)}}”,
“grant_type”: “authorization_code”,
“redirect_uri”: “{{oauth.localRedirectUri}}”
},
“type”: “urlencoded”,
“response”: {
“data”: {
“expires”: “{{addSeconds(now, body.expires_in)}}”,
“accessToken”: “{{body.access_token}}”,
“refreshToken”: “{{body.refresh_token}}”
}
}
}
}

Has anyone encountered this issue before and found a solution to ensure that Make properly stores the OAuth2 access token** after authentication?

Any insights would be greatly appreciated! Thank you in advance for your help.

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