Google Service account setup

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

When trying to setup my google service account with my private key (and the full json) the test is not passing and when I shut and reopen the google credential tab the key is replace by this “__n8n_BLANK_VALUE_e5362baf-c777-4d57-a609-6eaf1f9e87f6” also having this error message when trying it with a node “secretOrPrivateKey must be an asymmetric key when using RS256”.

I have seen some people having these exact issues on previous n8n version. (1.25) and I wonder if this was not fix or if I was doing it in the wrong way.

I would largely prefer using service account rather than OAuth fro my current project.

Thank you for your time and sorry for the bad english.

Information on your n8n setup

  • n8n version: 1.95.3
  • n8n EXECUTIONS_PROCESS setting (default: own, main): I dont know
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux (ubuntu)

The “blank” value is a dummy value populated in the UI to avoid echoing back the actual key value. The only way you usually even see that is if you switch the masked field (e.g. Private Key) from fixed to expression. So, whatever key value you originally pasted in is still encrypted and stored in the n8n DB. It hasn’t been replaced by the dummy value. Those fields probably shouldn’t allow switching to expression mode, but that is most likely WAYYY down the list of priorities of things to fix.

Assuming you have the correct permissions assigned to the Service Account, and the node you are using is compatible with the service account credential type, it’s possible you could have copied/pasted the private key value incorrectly.

Update: (Had to look back and see how I got this to work.)

  1. The private key needs to have all the \n characters including the one at the end. Copy everything within the quotes.
  2. The email should be the IAM generated email on the service account.
  3. You will then need to share access to resources (like Google Sheets) with the service account email before you can use the corresponding node in n8n to access those resources.

Just help other on this recently.

The error you get is paste the wrong key

Hope this image explains well on what you need to copy as key.

Thank you guys, I think I was indeed formatting my sercret incorrectly/mislead by the grey before tyipng my input.

Discussion can be closed !

Thanks again.