postman server basic auth and bearer token

314 Views Asked by At

When I load my staging environment from the browser, a popup appears for me to fill in username and password. If credentials are correct, I can load the website, otherwise I get a nginx auth error.

I also have a local environment that has no server credentials. On this environment I can call my api via postman by simply giving the bearer {token} and it works as expected.

On my staging environment, however, when I call the same api with the appropriate token for the staging environment, I get an auth error (401). I think it happens because of the server auth that blocks postman call.

If I change postman auth from bearer token to basic auth with my server username and password, I successfully pass the server auth but then the api fails because there is no token so I'm not authorize to access those resources.

How can I successfully test my api? Is there a way to give postman both basic and token auth?

0

There are 0 best solutions below