# Cannot Authenticate my Server to Server app and get my first token

**URL:** <https://devforum.zoom.us/t/cannot-authenticate-my-server-to-server-app-and-get-my-first-token/96154>\
**Category:** Authentication\
**Created:** [October 3, 2023, 8:49am UTC](https://devforum.zoom.us/t/cannot-authenticate-my-server-to-server-app-and-get-my-first-token/96154 "2023-10-03T08:49:50Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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 3, 2023, 5:57pm UTC](https://devforum.zoom.us/t/cannot-authenticate-my-server-to-server-app-and-get-my-first-token/96154/5 "2023-10-03T17:57:53Z")

</div>

Hi @thierry ,

Ahh, try referring to this thread:

cURL:

> [@Server-to-Server OAuth returns 400 when requesting access token - Powershell](https://devforum.zoom.us/t/server-to-server-oauth-returns-400-when-requesting-access-token-powershell/76999/2):
>
> Hi, @zoom123, Thank you for posting in the Developer Forum – I am happy to help. Sorry to hear that you getting 400 bad request. Can you try to make the request with the following curl command : curl --location --request POST 'https://zoom.us/oauth/token?grant\_type=account\_credentials&account\_id={accountId}' \ --header 'Authorization: Basic Base64Encoder(clientId:clientSecret)' \ --data-raw '' Also, there is a helpful utility script to generate a Zoom Server-to-Server Oauth Token and copy it …

Powershell:

> [@Server-to-Server OAuth returns 400 when requesting access token - Powershell](https://devforum.zoom.us/t/server-to-server-oauth-returns-400-when-requesting-access-token-powershell/76999/6):
>
> Some potential areas you may want to check: Use a single-byte encoding like ASCII or UTF-8. Encode using base64url encoding, which replaces certain characters and discards padding. Actually, my current Server-to-Server OAuth implementation is using base64 encoding; it was JWT that used base64url encoding. A .NET Framework / PowerShell compatible implementation for both of the above might be available via [Microsoft.IdentityModel.Tokens.Base64UrlEncoder.Encode](https://learn.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.tokens.base64urlencoder.encode).

---

_[View the full topic](https://devforum.zoom.us/t/cannot-authenticate-my-server-to-server-app-and-get-my-first-token/96154)._
