# Advanced OAuth2 request with custom header

**URL:** <https://community.postman.com/t/advanced-oauth2-request-with-custom-header/75593>\
**Category:** Help Hub\
**Tags:** oauth2\
**Created:** [February 17, 2025, 6:31pm UTC](https://community.postman.com/t/advanced-oauth2-request-with-custom-header/75593 "2025-02-17T18:31:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aviation-physicist-9](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@aviation-physicist-9](https://community.postman.com/u/aviation-physicist-9)\
**Post date:** [February 17, 2025, 6:31pm UTC](https://community.postman.com/t/advanced-oauth2-request-with-custom-header/75593/1 "2025-02-17T18:31:21Z")

</div>

Hello. I’m trying to execute an OAuth2 interactive request from Postman using the Advanced feature and adding a custom header. Per this except from the documentation, I should be able to add one:

**Auth Request** , **Token Request** , and **Refresh Request** - Define any custom parameters you want to send with auth requests, token requests, or refresh requests. For each key-value pair you define, select an option to send the parameter in the request body, request URL, or request headers.

However, I don’t get the option to specify how to send the auth request. By default, it’s sending the KVP in the query string. How do I get this to be sent via a custom header instead? Basically, I need to be able to send a custom JWT using Demonstrated Proof of Possession (DPoP) which I can’t do using a query string per RFC 9449. Is there some way to do this using a pre-request script instead? Thanks in advance for your help.

---

<div class="post-metadata">

**Author:** ![aviation-physicist-9](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@aviation-physicist-9](https://community.postman.com/u/aviation-physicist-9)\
**Post date:** [February 18, 2025, 4:04pm UTC](https://community.postman.com/t/advanced-oauth2-request-with-custom-header/75593/2 "2025-02-18T16:04:49Z")

</div>

I managed to get a working solution by executing a dummy request first and using a pre-request script to generate a JWT then setting an environment variable with this value. From there, I executed an OAuth2 request via the Get New Access Token button, authenticated interactively, then called a target API passing my AT and a new DPoP token set with a pre-request script similar to the first one I generated. Would be nice not to have to do the dummy request to set my initial DPoP token, but it works.

 ![Postman_OAuth2_dpop_custom_header](https://us1.discourse-cdn.com/getpostman/original/3X/c/2/c2229b7d23319ce9b1796158361f0f6d41e0caa1.png)
