Best answer

Change basic-auth to bearer tokin in webhook

  • 5 May 2021
  • 8 replies
  • 268 views

I’m build a zap to interact with a REST API calling a GET method and putting the information on google sheets.

 

The API uses Bearer Token method to authenticate. In webhook form, I only can set basic auth. 

 

How can I change the authenticate method to Bearer Token?

 

icon

Best answer by Troy Tessalone 5 May 2021, 17:47

View original

8 replies

Userlevel 7
Badge +11

Hi @Caio Ferreira 

You can set in the Headers section at the bottom.

Left Side: Authorization

Right Side: Bearer [TOKEN]

Hi @Troy Tessalone 

Thanks for answer.

I tried and returned HTTP 403 - Forbidden.

So, I tried to without “Bearer” before the token and returnd 401 - Unnauthorized

 

Userlevel 7
Badge +11

@Caio Ferreira 

Can you share screenshots of how your Webhooks step is currently configured?

 

 

Userlevel 7
Badge +11

@Caio Ferreira 

You appear to be using a REFRESH Token but likely should be an ACCESS Token.

I’d reference the APIs documentation to better understand the 401 and 403 errors you were getting.

Thanks!

 

I formated the field to change the word “REFRESH” to “AUTH” and works!.

I’m seeing the same issue. I even just tried to hardcode a valid access token in the header and continue to see the same 403 issue. Any inputs? 

 

 

Userlevel 2
Badge

Hi @Harsha 

 

It will largely depend on the type of API token the specific API authentication is looking for, but one way to convert a 'basic auth' code into a valid token is using the base64 encoder:

https://www.base64encode.org/

 

For example you can convert a basic auth sequence like below into a readable 'basic' token by entering into the coder to produce the required token string, then use the header 'Authorization' and output of 'Basic xxxxxxxxxxx' from the encoder.

 

Regards, Michael

consumer_key:consumer_secret

Reply