i’m trying to connect a client to a n8n automation that responds to client reviews of their businessess. The problem is that since i don’t have access to their gmail account i can’t sign in after i’ve created the Client Oauth credentials ( with their account through sharing screen ).
I have the option of going there and initiating the account wich would grant me access for 7 days, after that this message appears:
The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.
How can I avoid the problem and not have to sign in again with their gmail account ( wich fixes that problem but I can’t be doing that every week )?
Is there any way of maybe doing HTTP requests to get a new token every time so it doesn’t expire, of course the google business profile api credential doesn’t have a place for a refresh token so doing an http request is what I think would let me have the same result as the api but be able to include the refresh token obtained in an http.
Thanks in advance.
Marc
Information on your n8n setup
**n8n version: 1.82.1 (Latest Stable)
**n8n EXECUTIONS_PROCESS setting (default: own, main): Schedule trigger wich activates twice a day and then i’m using the google business profile api ( get many reviews ) Planing to change from api to HTTP request.
**Running n8n via (Docker, npm, n8n cloud, desktop app): I’m using n8n cloud
Use his account
Publish the app in your Google Cloud Console, log into the GMail account in your browser and add the credentials in your n8n. That way n8n handles the OAuth process and the credential never exepires.
Authorize his account in your app
In your app add the scopes you need for managing the Gmail account and go through the verification process (it’s boring and takes time).
After that build an OAuth link for your client to authorize your access.
The OAuth link looks something like this (I’ve asked ChatGPT to build mine):
I did the solution you mention in number 1 already with another account but it ended up getting expired, is there any way this is possible having done what you mention? Probably i did something wrong.
How long later did it expire? What error did you encounter?
I believe, typically, as long as the creds are in use, they auto refresh, but if unused for long periods, could expire. Google also now incorporates total limits on some creds as well, even with auto refresh, they will need to be reconnected after 6-12 months (in some cases)