Which authorisation type should I use to accessing BigQuery API through HTTP request node and a service account


Hopefully a simple answer. I am trying to access the BigQuery API through the HTTP request node using a service account, but I do not know which Authorisation type to use:

I have done a bit of searching with no luck. Happy to be directed to some documentation that might help.

Many thanks

Hi @got_flat, welcome to the community!

Google’s Service Account authentication is a rather painful topic, so you might want to consider using the OAuth2 approach instead.

In the end you will send a token, but you would need to build the valid JWT token first as described here in Google’s docs. This is nothing n8n offers out of the box (you might want to raise a feature request for this though, and also leave a vote on this related request), so you would need to write this yourself I am afraid, for example using the Code node, then use it in your HTTP Request node.

n8n’s pre-built BigQuery node uses custom code for this.

1 Like

I have read so many replies from you MutedJam, it feels like I am meeting a celebrity.

Thanks for your response.

I was having issues with Drive permissions using the OAuth2 approach, so thought I would troubleshoot using a service account.

You have given me more than enough to go off, I appreciate your assistance.

1 Like

You give me too much credit here :see_no_evil:

Perhaps you can describe the Drive problems you are having? Are you trying to perform any operation not supported by the native BigQuery node or is there any other reason you are using the HTTP Request node over the BigQuery one?

I looking for the same solution , about geting a GCP access token bearer from n8n , how can use the code to do so ?

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