Hi everyone, this is my first time writing here. I am getting the hang of Postman, but ran into the following snag while trying to streamline the Authorization process. Any advice much appreciated. Thanks !
Describe the bug
Postman removes headers/params from request after OAuth2 Authorization
To Reproduce
Steps to reproduce the behaviour:
-
Go to Authorization tab, click new access token, and request a token
-
I am using this pre-request Script:
function create_jwt(access_token) { //... } oauth_access_token = pm.request.auth.current().accessToken jwt_token = create_jwt(oauth_access_token) pm.request.headers.add({key: 'Authorization', value: 'Bearer ' + jwt_token })
-
When finally we make the API request, Postman replaces the header that was set in pre-request Script and puts the original access token back into the header
Is there any way to tell Postman not to replace the header?
Expected behaviour
Hoped Postman would leave the pre-request script headers alone, so the new access token would appear in the header.
Screenshots
App information:
- App Type [e.g. Chrome App, Native App]
- Postman Version [e.g. 6.0.1]
- OS: [e.g. macOS High Sierra 10.13.2]