This is an example of the full usage:
I created an token
variable inside the vault for security reasons, I called it as token
, and added the token in the var value. And, for the allowed domains, I added my IP (let’s say, here, that it’s http://123.345.6.7:8180
- Postman removes the port automatically).
So, I created an Environment
, that contains my baseUrl
(my IP address). Also, I created the segment (let’s say, also here, that it’s postman/test
) (The current value is the same as the initial value).
After this, I connected to the correct Environment
, and created the following request in a Folder inside Collection:
For now, the full URL would be the following:
http://123.345.6.7:8180/postman/test/desiderd_endpoint
But I need to be authenticated in order to receive the data, so, I add in the Headers
, the Authorization
method (API Key), with the value as {{vault:token}}
, all this in my Collection.
Now, I go into the folder that contains the desired endpoint, I verify if the Authorization is using Inherit auth from Parent, and also verified if the folder is using the same configuration, Inherit auth from Parent. Everything looks to be correctly setted.
When I try to call the request, it returns me that I’m using invalid credentials, taking a look at the console, it has the following:
GET http://123.345.6.7:8180/postman/test/desired_endpoint
Status: 401 - Unauthorized
Request headers:
Authorization: {{vault:token}}
Response body:
{"error": "Invalid credential"}
But, if I remove the domain from the allowed domains, it works:
GET http://123.345.6.7:8180/postman/test/desired_endpoint
Status: 200 - OK
Request headers:
Response body: