# Set Authentication Type and details in pre-request-script

**URL:** <https://community.postman.com/t/set-authentication-type-and-details-in-pre-request-script/13813>\
**Category:** Help Hub\
**Tags:** authentication, testscripts, pre-request-script\
**Created:** [July 1, 2020, 2:00pm UTC](https://community.postman.com/t/set-authentication-type-and-details-in-pre-request-script/13813 "2020-07-01T14:00:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hillebo](https://avatars.discourse-cdn.com/v4/letter/h/bb73d2/32.png) [@Hillebo](https://community.postman.com/u/Hillebo)\
**Post date:** [July 1, 2020, 2:00pm UTC](https://community.postman.com/t/set-authentication-type-and-details-in-pre-request-script/13813/1 "2020-07-01T14:00:54Z")

</div>

I would like to be able to dynamically set the Authentication Type and Details in the pre-request-script.

The two APIs I would like to connect to use either “OAuth 2.0” or “Basic Auth”.

Thank you for your time!
