usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
27.34k stars 1.25k forks source link

Exception when using OAuth 2.0 (client credentials) to authorise after updating to v1.29.0 from v1.28.0 #3135

Closed Reece-Carruthers closed 1 month ago

Reece-Carruthers commented 1 month ago

I have checked the following:

Describe the bug

Hi, I am facing issues with the latest version of Bruno. My Bruno scripts make use of the OAuth 2.0 authentication tab utilising the client credentials drop-down option. After the update when pressing get access token I receive an error pop-up with the below exception:

Error invoking remote method 'send-collection-oauth2-request': TypeError: Cannot read properties of undefined (reading 'formSerializer')

Downgrading to the older version of Bruno fixes the issue, I was wondering if something has changed in the way we need to use the OAuth 2.0 authentication, or if this is a bug?

.bru file to reproduce the bug

https://github.com/hmrc/uknw-auth-checker-api/tree/main/.bruno/dev-staging-et

Screenshots/Live demo link

image Screencast from 18-09-24 15:56:02.webm

enricojonas commented 1 month ago

Guess it's the same bug as https://github.com/usebruno/bruno/issues/3129

Reece-Carruthers commented 1 month ago

@enricojonas Yep, looks to be the same issue just a different method. That'll be why it didn't pop up when I searched the exception! I'll leave this open encase it proves useful to the developers.

mjhcorporate commented 1 month ago

I just ran into the same bug in one of my collections 🤦 @helloanoop : This is something worth fixing. The Content-Type header is present in a lot of collections that were migrated from Postman or Insomnia.

helloanoop commented 1 month ago

We just released a patch fix v1.29.1 that should have fixed this issue. Can you please test.

weretac0 commented 1 month ago

I updated to resolve this issue and while I am getting a token correctly now, when I invoke the POST URL it's actually calling the OAUTH endpoint and just giving me the JSON response with the access_token and not the URL configured for the request.

Bug

Reece-Carruthers commented 1 month ago

@helloanoop The patch has fixed the issue, thank you for resolving it so soon.