How do I give Retool access to a Cloud Functions endpoint that requires authentication?

I lost an afternoon trying to understand how it works. I didn't found how it works.

@joeBumbaca Thanks for putting together the GServiceAccount dashboard to try out although I think it may now be broken? I've tried testing it out and replaced all of the inputs and I just get the error "SignJWT failed (0.014s):init failed:malformed plain PKCS8 private key(code:001)"
I'm grabbing the private key from Firebase in the format it comes in but no luck so far.

1 Like

Any updates on this?
I've tried @joeBumbaca solution but I get the same error @rlindsey2 told about, "SignJWT failed (0.014s):init failed:malformed plain PKCS8 private key(code:001)"

Is there a best practices workflow for using retool OAuth resource with Google Cloud functions that require authentication? I have followed the steps in the docs and here to create an Oauth client and obtain access/id tokens but the tokens I get back do not have the authorization to call cloud functions. I am positive my account has the correct IAM permissions to invoke them. I have been banging my head against the wall trying to figure out what step I am missing, any help would be appreciated!

Hey everyone, I do see that this library for signing the JWT no longer works in this app unfortunately I don't have any fixes for that. We do have an internal ticket tracking this issue and are looking into what it would take to allow this natively. We will update here when there is any additional information. Thanks :grin:

1 Like

Hey everyone, i was working in a project that needed this feature, so i updated @joeBumbaca solution. So here i leave a json with a template to use authorization in protected google cloud functions. Remember to add the target_audience in the serviceAccountKey variable object
GServiceAccountAuth.json (23.4 KB)

1 Like