# S2s oauth - unsupported\_grant\_type

**URL:** <https://devforum.zoom.us/t/s2s-oauth-unsupported-grant-type/97144>\
**Category:** Authentication\
**Created:** [October 20, 2023, 10:23pm UTC](https://devforum.zoom.us/t/s2s-oauth-unsupported-grant-type/97144 "2023-10-20T22:23:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![brendan\_meetingsdk](https://avatars.discourse-cdn.com/v4/letter/b/ecd19e/32.png) [@brendan\_meetingsdk](https://devforum.zoom.us/u/brendan_meetingsdk)\
**Post date:** [October 20, 2023, 10:23pm UTC](https://devforum.zoom.us/t/s2s-oauth-unsupported-grant-type/97144/1 "2023-10-20T22:23:05Z")

</div>

I just can’t for the life of me figure out what I am doing wrong. I can’t get any solution in any other topic to work. I’m trying to get the access\_token from the …/oauth/token (url wasn’t allowed) endpoint.

I’m following the guide at: [Server-to-Server OAuth](https://developers.zoom.us/docs/internal-apps/s2s-oauth)

No matter what I do, I get the error: “unsupported\_grant\_type”

My JS attempt

```auto
async getAccessToken() {
            const data = qs.stringify({
                'grant_type': 'account_credentials',
                'account_id': this.accountId
            });

            const config = {
                method: 'post',
                url: 'https://zoom.us/oauth/token',
                headers: {
                    'Host': 'zoom.us',
                    'Authorization': 'Basic ' + Buffer.from(`${this.clientId}:${this.clientSecret}`).toString('base64'),
                    'Content-Type': 'application/x-www-form-urlencoded'
                },
                data: data
            };

            try {
                const response = await axios(config);
                return response.data;
            } catch (error) {
                console.error(error);
                throw error;
            }
    }

```

My postman attempt:  
POST: …/oauth/token (url wasn’t allowed)

\*\* image wasn’t allowed  
But I was sending body as x-www-form-urlencoded  
grant\_type=account\_credentials  
account\_id=\*\*\*\*

The authentication seems correct because if I change it the error becomes invalid\_client.

I also tried sending the grant\_type as a param instead,  
I also tried sending the post as form-data and json.

What am I missing?

---

<div class="post-metadata">

**Author:** ![brendan\_meetingsdk](https://avatars.discourse-cdn.com/v4/letter/b/ecd19e/32.png) [@brendan\_meetingsdk](https://devforum.zoom.us/u/brendan_meetingsdk)\
**Post date:** [October 21, 2023, 2:11am UTC](https://devforum.zoom.us/t/s2s-oauth-unsupported-grant-type/97144/2 "2023-10-21T02:11:00Z")

</div>

So it turned out I was using meeting sdk app details.  
Not the s2s app details.

Why this results in “unsupported\_grant\_type”? NO IDEA.

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [October 23, 2023, 12:30pm UTC](https://devforum.zoom.us/t/s2s-oauth-unsupported-grant-type/97144/4 "2023-10-23T12:30:17Z")

</div>

Hi @brendan_meetingsdk ,

Is this resolved?

Since, you’re passing grant type as account\_credentials, it sounds like your intended use is for S2S. You can verify the exact set up you need for either in our public workspace:

OAuth 2 Postman Workspace: [Postman](https://www.postman.com/zoom-developer/workspace/zoom-public-workspace/request/22097587-82698a23-7af5-4f3f-bf2e-a62c3eb8903d)

Server-to-Server: [Postman](https://www.postman.com/zoom-developer/workspace/zoom-public-workspace/folder/22097587-0021aa9e-17f5-478e-b106-dfb31b930153)

For S2S, no request body format is needed (unlike with OAuth 2.0):

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/3/1382c54aee59e3cbc353d04b84baae53457ae460.png)

---

<div class="post-metadata">

**Author:** ![andrewgstreet](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@andrewgstreet](https://devforum.zoom.us/u/andrewgstreet)\
**Post date:** [October 23, 2023, 8:34pm UTC](https://devforum.zoom.us/t/s2s-oauth-unsupported-grant-type/97144/5 "2023-10-23T20:34:53Z")

</div>

I’m having a very similar issue. Not matter what I try I always get

{“reason”:“unsupported grant type”,“error”:“unsupported\_grant\_type”}

Trying to get account credentials as outlined in the S2S documentation. I downloaded the s2s.js app, plugged in my credentials (as opposed the PHP script I’ve written) and it gives the same error. My app says ready to install. Not sure what this means. Whenever i try to add the app, it calls the listed Oauth endepoint (not sure why) instead of just installing.

Any help would be greatly appreciated. Can’t seem to get to step one, authorization. And without this, obviously nothing else is going to work.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [October 24, 2023, 2:49am UTC](https://devforum.zoom.us/t/s2s-oauth-unsupported-grant-type/97144/6 "2023-10-24T02:49:48Z")

</div>

@brendan_meetingsdk ,

I’ve had success with something like this, hope it helps

```auto
// Function to fetch a bearer token
async function fetchBearerToken() {
  try {
    // Create a Basic Authorization header with client credentials
    const credentials = Buffer.from(`${process.env.ZOOM_S2S_CLIENT_ID}:${process.env.ZOOM_S2S_CLIENT_SECRET}`).toString('base64');
    const apiUrl = `https://zoom.us/oauth/token?grant_type=account_credentials&account_id=${process.env.ZOOM_S2S_ACCOUNTID}`;
    
    // Define the token request parameters
    const tokenRequestData = {
      method: 'POST',
      url: apiUrl,
      headers: {
        'Authorization': `Basic ${credentials}`,
        'Content-Type': 'application/x-www-form-urlencoded',
      },
      
    };

    // Send the token request
    const response = await axios(tokenRequestData);

    // Extract the access token from the response
    const accessToken = response.data.access_token;
    // Return 
    return accessToken;
   
  } catch (error) {
    return error.message;
  }
}

```

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [October 24, 2023, 2:45pm UTC](https://devforum.zoom.us/t/s2s-oauth-unsupported-grant-type/97144/7 "2023-10-24T14:45:10Z")

</div>

> [@andrewgstreet](#):
>
> My app says ready to install. Not sure what this means. Whenever i try to add the app, it calls the listed Oauth endepoint (not sure why) instead of just installing.

“Ready to install” designates that you have built one of the other app types such as OAuth or Zoom Apps app-type.

A Server to Server OAuth app type will say “Deactivated” or “Activated”.

 ![Screenshot 2023-10-24 at 10.44.09 AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/9/7/9734c735fd101e07c62ef2f365d012fdbda39f0e.png)

---

<div class="post-metadata">

**Author:** ![Meathead](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@Meathead](https://devforum.zoom.us/u/Meathead)\
**Post date:** [October 25, 2023, 6:34pm UTC](https://devforum.zoom.us/t/s2s-oauth-unsupported-grant-type/97144/8 "2023-10-25T18:34:15Z")

</div>

Sorry, I should have been more clear. I was using the meeting sdk app credentials. Not the server-to-server oauth app credentials.

When changing to the correct credentials it worked fine

I am annoyed that the response was “unsupported\_grant\_type”. Which was wrong and had nothing to do with the actual problem. Which again, was wrong credentials.

Thanks for the replies.

I don’t know Andy’s situation. So can’t say if his issue is related or not.

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [October 25, 2023, 9:15pm UTC](https://devforum.zoom.us/t/s2s-oauth-unsupported-grant-type/97144/9 "2023-10-25T21:15:22Z")

</div>

Hi @brendan_meetingsdk thanks for clarifying. I’m happy it’s resolved!
