It seems like the scripting methods for pm.request.auth do not do anything at all.
My API has a strange authorization flow and I need to authenticate through OAuth and do some processing on the token before I use it in the Authorization header, but no matter what I do it seems that it is not possible.
Here is what I tried:
-
pm.request.authorizeUsing
It simply doesnโt do anything. It is not even possible to switch to no authorization at all, this call is simply ignored -
pm.request.upsertHeader
Doesnโt update Authorization header either -
pm.request.update({auth: { oauth2: [{type: 'any', key: 'accessToken', value: 'My updated header'}]} });
Request is still sent with the original header - Switched
Add Authorization Data to
Request URL and tried updating the both the headers and the URL. No authorization header is added, it is not possible to remove the extraneous authorization query parameter from the url viapm.request.url.removeQueryParams
I still have to use the OAuth2 authorization type on my request since I need to acquire a token through authorization_code grant and Postman doesnโt allow to show a sign-in popup through scripting.
Is there a way around this or is the scripting just extremely bugged?