Server-to-Server OAuth (invalid_client)


Format Your New Topic as Follows:

API Endpoint(s) and/or Zoom API Event(s)
Link the API endpoint(s) and/orZoom API Event(s) you’re working with to help give context.

https://zoom.us/oauth/token

Description
Details on your question, workflow or the problem you’re trying to solve.

Server-to-Server OAuth アプリを作成しました。

${Client ID}:${Client Secret}
に基づいて、

echo “M7YWZ4-XXXX:SHBB-XXXXXXXXXXXXXXXXXX” | base64
のようにして、以下の文字列を得ました。

TTdZV1o0ZEJRcnllMEI5bDRVXXXXXX=

以下のコマンドを実行すると、エラーが出ます。(invalid_client)

$ curl -X POST https://zoom.us/oauth/token -d ‘grant_type=account_credentials’ -d ‘account_id=wTQ5JXXXXXXX’ -H ‘Host: zoom.us’ -H ‘Authorization: Basic TTdZV1o0ZEJRcnllMEI5bDRVXXXXXX=’

{“reason”:“Invalid client_id or client_secret”,“error”:“invalid_client”}

何が間違っているのでしょうか?

Error?
The full error message or issue you are running into, where applicable.

{“reason”:“Invalid client_id or client_secret”,“error”:“invalid_client”}

How To Reproduce
Steps to reproduce the behavior:
1. Request URL / Headers (without credentials or sensitive info like emails, uuid, etc.) / Body
2. Authentication method or app type
3. Any errors

上で説明したとおりですが、
各キーの詳細はXXXXで消してあります。

Hi @hidemune ,

Please try generating your token using either our sample app:

GitHub - zoom/server-to-server-oauth-token: Utility script to generate a Zoom Server-to-Server Oauth Token and copy to clipboard

Or Postman workspace: Postman

ありがとうございます。

こちらを試してみました。

$ node --version
v12.22.9

$ export NODE_ENV='development'

$ node s2s.js
file:///home/user/git/Server-to-Server-Oauth-Token/s2s.js:9
const IS_PROD = process.env.NODE_ENV?.toString().toLowerCase().trim() === 'production';
                                     ^

SyntaxError: Unexpected token '.'

NODE_ENV?.
この部分でエラーになります。NodeJSの環境作成方法に誤りがあるのでしょうか?

$ nvm install v18.18.0

これで動きました。トークンが取得できました。
ありがとうございます。前進しました。

@hidemune please try the below

Please try this below
echo -n “M7YWZ4-XXXX:SHBB-XXXXXXXXXXXXXXXXXX” | base64

Please try this below
curl -X POST "https://zoom.us/oauth/token" -d 'grant_type=account_credentials' -d 'account_id= wTQ5JXXXXXXX' -H 'Authorization: Basic TTdZV1o0ZEJRcnllMEI5bDRVXXXXXX='

上手く行きました!

ありがとうございます!!

1 Like

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