04 Day 15 DayChallenge error with Api from Vault

I have error with API key from Vault. When I uses the same Api key without Vault it works.

I would be thanksfull for help as I can`t find what is the reason

My publik workspace - Postman. The first Day 4 - without Vault, the second with Vault

You’ve got the headers duplicated on the request, as well as the Collection Auth helper. The header in grey is inherited from the collection. The other one is set directly on the request. Case sensitivity does matters so they will both be sent.

image

Get used to using the console logs for troubleshooting. Have a look at what was actually sent for the request.

I found this yestoday too. Nevertheless this change nothing did not change the result

Have a look at the console log.

It should show you the headers. Is the correct value being shown, or it it showing no value, or just missing the header.

There is header x-api-key with hiden value. If I am right, the value from vault didnt come. And I havent any idea why
:arrow_forward:GET https://api.getpostman.com/collections401359 ms

GET /collections HTTP/1.1

x-api-key: *****

User-Agent: PostmanRuntime/7.39.0

Accept: /

Cache-Control: no-cache

Postman-Token: 3bdb48bd-6506-44dd-8a07-5c289a78a13d

Host: api.getpostman.com

Accept-Encoding: gzip, deflate, br

Connection: keep-alive

HTTP/1.1 401 Unauthorized

Date: Tue, 02 Jul 2024 14:47:21 GMT

Content-Type: application/json; charset=utf-8

Content-Length: 120

Connection: keep-alive

Server: nginx/1.25.3

x-frame-options: deny

x-xss-protection: 1; mode=block

x-content-type-options: nosniff

referrer-policy: no-referrer-when-downgrade

uWebSockets: 20

{“error”:{“name”:“AuthenticationError”,“message”:“Invalid API Key. Every request requires a valid API Key to be sent.”}}

Are you using the browser or desktop application?

I used the desktop aplication

I’m just testing it myself and was having a similar issue. (Using the web application).

I tried to setup the query parameter version and it gave me an error.

image

I’ve now tried it in the desktop application and it worked first time.

I deleted the fork and forked it again just to double check.

Added the vault secret (as I can see you changed the name to postman-api-key:value) and again, it worked first time.

You don’t actually get to see the vault values in the console log. Just “*****” which I can sort of understand but obviously makes it a bit harder to troubleshoot.

If its not working for you. I can only assume that the API key is incorrect. (It should start with PMAK-***, is that what you’ve got?)

I have regenerate api key. It`s help. Thank you for your support

1 Like