# Oauth 2 - The endpoint only accepts POST, OPTIONS requests

**URL:** <https://community.postman.com/t/oauth-2-the-endpoint-only-accepts-post-options-requests/55367>\
**Category:** Help Hub\
**Tags:** azure\
**Created:** [December 6, 2023, 11:02am UTC](https://community.postman.com/t/oauth-2-the-endpoint-only-accepts-post-options-requests/55367 "2023-12-06T11:02:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ogouret](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@ogouret](https://community.postman.com/u/ogouret)\
**Post date:** [December 6, 2023, 11:02am UTC](https://community.postman.com/t/oauth-2-the-endpoint-only-accepts-post-options-requests/55367/1 "2023-12-06T11:02:31Z")

</div>

I’m trying to configure my Postman .  
In a first step I configured a request that get me a token, then I copy the value in a variable !  
I’ve found the “Authorization” section that allows to set up a OAuth 2.0 , but I can’t figure out how to define the “method” to “POST” , is it possible ?  
Here is how i’ve configured it :

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/c/1/c10472b0391b4327e9e3636ec34b0ede4b2f0d70.png)

I found a script ([Customize oauth2 refresh token url](https://community.postman.com/t/customize-oauth2-refresh-token-url/43922)), but i think i’m not so far to make it work using postman functionalities

---

<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:** [December 6, 2023, 12:51pm UTC](https://community.postman.com/t/oauth-2-the-endpoint-only-accepts-post-options-requests/55367/2 "2023-12-06T12:51:03Z")

</div>

The OAuth standard only accepts POST, which is why there aren’t any options to change it. It will be a POST request by default.

Send the request, and then check the response in the console logs.  
The Microsoft endpoints usually return some detail on what is wrong with an request.

---

<div class="post-metadata">

**Author:** ![ogouret](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@ogouret](https://community.postman.com/u/ogouret)\
**Post date:** [December 6, 2023, 12:57pm UTC](https://community.postman.com/t/oauth-2-the-endpoint-only-accepts-post-options-requests/55367/3 "2023-12-06T12:57:23Z")

</div>

I’ve finally understood my mistakes , here is how to configure , the “grant type” was invalid :

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/2/d/2d559b2b3e12a298aa042cba4f9eeeccabf8ff4f.png)

Update : you don’t need to fill in the “Refresh Token URL”, as it uses the “Access Token URL” if empty

---

<div class="post-metadata">

**Author:** ![ogouret](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@ogouret](https://community.postman.com/u/ogouret)\
**Post date:** [December 6, 2023, 1:01pm UTC](https://community.postman.com/t/oauth-2-the-endpoint-only-accepts-post-options-requests/55367/4 "2023-12-06T13:01:16Z")

</div>

It stranges, because as I said in a first step, I configured a request to get the token, but it’s a GET request :

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/f/5f1359f8d1401bae03e59bb5b0ce1319237ebe2c.png)

---

<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:** [December 6, 2023, 1:14pm UTC](https://community.postman.com/t/oauth-2-the-endpoint-only-accepts-post-options-requests/55367/5 "2023-12-06T13:14:43Z")

</div>

Very strange, as all of my requests to that token end point are POST requests.

For example…

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/5/d/5dbf84e1dcea1cd7e296c8d2fbcd78b22bf7aff2.png)

I wonder if the Microsoft API can handle both methods.

You might want to take a look at the following question on Stack Overflow.

[authentication - Should clients get OAuth 2 access tokens using GET or POST? - Stack Overflow](https://stackoverflow.com/questions/8274819/should-clients-get-oauth-2-access-tokens-using-get-or-post)

---

<div class="post-metadata">

**Author:** ![ogouret](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@ogouret](https://community.postman.com/u/ogouret)\
**Post date:** [December 6, 2023, 1:37pm UTC](https://community.postman.com/t/oauth-2-the-endpoint-only-accepts-post-options-requests/55367/6 "2023-12-06T13:37:18Z")

</div>

I can see a major difference with my request : you connect using “username/password”, while i connect using an app that I declared in Azure AD, and my “grant\_type” is “client\_credentials”.  
But as I said now i successfully configured my “authorization” at the collection level all is OK for me.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [January 5, 2024, 1:37pm UTC](https://community.postman.com/t/oauth-2-the-endpoint-only-accepts-post-options-requests/55367/7 "2024-01-05T13:37:44Z")

</div>

Closed on January 5, 2024, 1:37pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
