S
Supabase2mo ago
d rose

Authenticated Webhook

Hey, I need to set up a webhook for some tables that calls an api in my backend. I need to somehow authenticate the request to prove its coming from us. I noticed for a webhook that calls an edge function, supabase gives the option to add the auth header with our api key, but this option isnt there for http requests. Is there any recommended way to authenticate the request for an http request?
4 Replies
garyaustin
garyaustin2mo ago
You can hard code a secret key header is about the only way with webhooks. But you can also use a table trigger function and call pg_net with whatever you want and not use the more limited webhooks.
d rose
d roseOP2mo ago
I think i will do the second and maybe pull a secret from the vault? Thanks
garyaustin
garyaustin2mo ago
I use the vault for secrets and not hardcode so I can change for dev/production if need be.
d rose
d roseOP2mo ago
cool thanks

Did you find this page helpful?