Using Vault sends values as {{vault:token}} instead of real value

I’m trying to use Postman Vault to make the authentication in my requests, but, instead of sending the actual value, it sends it as {{value:token}}.

I’m using Postman for Windows, adding to my Collection the Authorization method as API Key, in the moment I try sending the request, it returns that the headers as Authorization: {{vault:token}}.

Is there any way to fix it?

vault, authorization, authentication

Hey @balzanelli :wave:

Welcome to the Postman Community! :postman:

Which version are you using? This is the desktop app or the web browser version?

Do you have any specific domains set for the Vault variable?

It’s Postman Desktop app for Windows.

I’ve set my localhost address (IP) for the allowed domains.

Out of interest, if you remove that domain so the vault variable could be used on any many - Does that resolve it in the request?

Removing the domain solved the issue, thank you!

Awesome! I’d still love to get to the bottom of why it’s not working for the ip address.

Do you / did you include http:// with your ip address when you tried it?

The domains auto default to https:// so that might be the issue.

Yes, I’ve added as http:// when addind the IP.

image

The console also returns me the correct IP requested.

1 Like

Were you also mentioning localhost in the URL or was that just {{vault:var_name}}/endpoint.

Still trying to build up the picture of what you had and why it wasn’t working as we’re unable to recreate it. :frowning:

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.

image

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:

  • Authorization: *****

Response body:

  • data
1 Like

This is the request, website didn’t allow me to add more than 3 embbeds:

image

Would any other info help you?

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.