How to handle HTTP redirection and listen for the reply

Hi,

I am trying automate an OAuth2.0 hybrid flow which is very similar to Authorization code flow supported by Postman by default. This has been requested at [1] too.

Step-wise what I am trying to do is,
Call a get on authorize url with some parameters similar to authorization code flow,
Handle the redirection to login page of Identity Provider
Wait for the code to receive at callback URL (callback URL will be configured to a URL as https://www.getpostman.com/oauth2/callback )
Then do some validations on the received parameters and initiate the token request.

I could figure out that Postman make use of Electron to openup the redirected login page of Identity Provider for the user, but I am clueless how the waiting on callback URL is done.

Appreciate any pointers. I will happily contribute the functionality to Postman if it helps with fixing the issue [1], if I could make it. :slight_smile:

[1] - https://github.com/postmanlabs/postman-app-support/issues/2209