# Authorization per Environment

**URL:** <https://community.postman.com/t/authorization-per-environment/9036>\
**Category:** Help Hub\
**Tags:** authentication\
**Created:** [November 15, 2019, 11:38am UTC](https://community.postman.com/t/authorization-per-environment/9036 "2019-11-15T11:38:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![desmond.kirrane](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/desmond.kirrane/32/3251_2.png) [@desmond.kirrane](https://community.postman.com/u/desmond.kirrane)\
**Post date:** [November 15, 2019, 11:38am UTC](https://community.postman.com/t/authorization-per-environment/9036/1 "2019-11-15T11:38:15Z")

</div>

Hi, I have a number of Environments with different username/passwords for login.  
Can I configure an Authorization per Environment?

---

<div class="post-metadata">

**Author:** ![odanylewycz](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/odanylewycz/32/3240_2.png) [@odanylewycz](https://community.postman.com/u/odanylewycz)\
**Post date:** [November 15, 2019, 12:18pm UTC](https://community.postman.com/t/authorization-per-environment/9036/2 "2019-11-15T12:18:01Z")

</div>

Hi @desmond.kirrane,

Welcome to the community! 👏

If the type of authorization is the same between environments, you can use environment variables in the authorization tab in order to change your authorization credentials per environment. Assuming Basic Authorization, Simply make a username and password variable in each environment and they’ll get filled in appropriately.

If they are not the same type of authorization (bearer token, hawk, etc) then you can’t do so via the method I explained above. But you can store credentials in your environment with no problem and you can make it work by calling your authorization appropriately.

Just be weary of using sensitive credentials in a environment shared by a team, unless they are shared credentials 😉.

Hope this helps!

Regards,  
Orest

---

<div class="post-metadata">

**Author:** ![knychtell](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@knychtell](https://community.postman.com/u/knychtell)\
**Post date:** [October 21, 2020, 3:26am UTC](https://community.postman.com/t/authorization-per-environment/9036/3 "2020-10-21T03:26:31Z")

</div>

Hi Orest,

sorry to barge into this thread. what if the creds are api key id and secret that is on the body of the first post, say login post. then the asc\_ssession\_id is generated on the response header.

how can i use the value of the header if the succeeding api calls need the value but with a different header, say asc\_xsrf\_token?

thanks,  
knychtell

---

<div class="post-metadata">

**Author:** ![odanylewycz](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/odanylewycz/32/3240_2.png) [@odanylewycz](https://community.postman.com/u/odanylewycz)\
**Post date:** [October 21, 2020, 2:33pm UTC](https://community.postman.com/t/authorization-per-environment/9036/4 "2020-10-21T14:33:18Z")

</div>

Hi @knychtell,

Not a problem! I think I understand what you are asking, though I am not 100% certain.

For succeeding requests using that asc\_session\_id, you would just place the variable value where its supposed to go. That shouldnt be a problem. First you would save that asc\_session\_id as a variable when handling the callback response, and then use it wherever.

As for the asc\_xsrf\_token, that depends on what your web server expects, but if its just a normal XSRF type token, you should be able to generate one client side with no problem. I believe you can just make it some random string of characters. Then you would just place that in your header.

I hope this answers your question!

Best,  
Orest

---

<div class="post-metadata">

**Author:** ![malcolm.young](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/malcolm.young/32/7538_2.png) [@malcolm.young](https://community.postman.com/u/malcolm.young)\
**Post date:** [March 4, 2021, 10:36am UTC](https://community.postman.com/t/authorization-per-environment/9036/5 "2021-03-04T10:36:41Z")

</div>

I have a very similar use case. For the test and production environments, I need to use an `authToken`, but for local development, I need to set it to `No Auth`.

At the moment, I’m working around this by overriding the auth setting on each request, but it’s not ideal.

Is there any way to set `No Auth` for all requests in the environment?

From the reply from @odanylewycz it sounds like this isn’t currently available - how can we make this feature request?

---

<div class="post-metadata">

**Author:** ![odanylewycz](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/odanylewycz/32/3240_2.png) [@odanylewycz](https://community.postman.com/u/odanylewycz)\
**Post date:** [March 5, 2021, 12:21am UTC](https://community.postman.com/t/authorization-per-environment/9036/6 "2021-03-05T00:21:29Z")

</div>

Hi @malcolm.young,

Welcome to the community! 👏

That would be a great feature request. It might be possible to make changes using the Postman Collection SDK, which you can find here [Request - Postman Documentation](https://www.postmanlabs.com/postman-collection/Request.html). Now I honestly don’t know if you can use this the adjust the main request using the SDK to set the RequestAuth to nothing, and then reset it to authToken when in production (you can use an environment variable as a flag), however, I don’t think that is quite possible. This would be a good question to ask the development team, and if not possible, you can submit a request on their github page, or in their RFC section of the community.

> **[Postman Inc.](https://github.com/postmanlabs?page=1)**
>
> Postman Inc. has 98 repositories available. Follow their code on GitHub.

> **[RFCs (Request for Comments)](https://community.postman.com/c/rfcs/25)**
>
> RFCs from the Postman team on features that are under active development and need community input.

Hope you can find something to make this a littles less of an annoyance!

Best,  
Orest
