How to Add an OAuth2 API Resource with Base64-Encoded Client Credentials for eBay?

Hi everyone,

I'm trying to add a REST API resource in Retool to connect to eBay using OAuth2. However, eBay requires the client_id and client_secret to be sent in the Authorization header as a Base64-encoded string (Basic base64(client_id:client_secret)).

I couldn't find an option in Retool to configure this directly in the API resource settings. Has anyone successfully set this up? Do I need to handle this manually in a query or is there a built-in way to achieve it?

Thanks for your help!

Hey @dotim,

I think the way to approach this is:

  • Define your client_id and client_secret as configuration variables
  • Create a custom auth where you can use JS block and generate and define a new variable for yoru encoded string (Basic base64(client_id:client_secret) )
  • Add a new step with an API request where then you can refer to the new variable in teh Authorization Header

Hope this helps!

Welcome to the community, @dotim! Thanks for reaching out.

While custom authentication is definitely a viable solution, there are a few different integrations that requires this same pattern and we've added a Beta toggle that will do it for you.

I hope that helps! Let me know if you have any additional questions.

1 Like

It looks like there's a Beta flag for this, which is great! But your solution was also working. Thanks for the help! :raised_hands: