# Browser-based PKCE auth token automation doesn't work with MS AAD

**URL:** <https://community.postman.com/t/browser-based-pkce-auth-token-automation-doesnt-work-with-ms-aad/44085>\
**Category:** Help Hub\
**Tags:** authentication\
**Created:** [February 16, 2023, 6:42pm UTC](https://community.postman.com/t/browser-based-pkce-auth-token-automation-doesnt-work-with-ms-aad/44085 "2023-02-16T18:42:22Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 17, 2023, 11:11am UTC](https://community.postman.com/t/browser-based-pkce-auth-token-automation-doesnt-work-with-ms-aad/44085/3 "2023-02-17T11:11:13Z")

</div>

Actually saying that, not sure if the built in authentication supports this yet.

[Add `Origin` header to OAuth 2.0 flow - Help - Postman](https://community.postman.com/t/add-origin-header-to-oauth-2-0-flow/39402)

Therefore you may have to use sendRequest in a pre-request script to generate your token instead where you should be in full control of what headers you send.

Or you could craft a Post request with all of the settings. I prefer the pre-request script as you can handle the token expires with simple IF statements.

---

_[View the full topic](https://community.postman.com/t/browser-based-pkce-auth-token-automation-doesnt-work-with-ms-aad/44085)._
