# Invalid Signature issue

**URL:** <https://devforum.zoom.us/t/invalid-signature-issue/131217>\
**Category:** Meeting SDK\
**Created:** [April 9, 2025, 9:06am UTC](https://devforum.zoom.us/t/invalid-signature-issue/131217 "2025-04-09T09:06:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed4](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mohamed4/32/55226_2.png) [@mohamed4](https://devforum.zoom.us/u/mohamed4)\
**Post date:** [April 9, 2025, 9:06am UTC](https://devforum.zoom.us/t/invalid-signature-issue/131217/1 "2025-04-09T09:06:29Z")

</div>

### What I’m Trying to Achieve

- Register/login users via my custom backend.
- Create a Zoom meeting using the Zoom API.
- Start or join the meeting using the Zoom Meeting SDK in the browser.

### Current Setup

#### Frontend (Next.js with Zoom Meeting SDK 3.12.0)

- I’m loading the Zoom Meeting SDK scripts dynamically and initializing it once loaded.
- Users can register/login, create a meeting, and attempt to start/join it.
- Relevant code snippet:

```auto
window.ZoomMtg.init({
  leaveUrl: " ***localhost:3000***",
  isSupportAV: true,
  success: () => {
    window.ZoomMtg.join({
      signature: meetingData.signature, // Fetched from backend
      meetingNumber: meetingData.meetingNumber,
      userName: formData.name || "Zoom User",
      sdkKey: "UoCjUegUT16YHg1qRgb0Dg",
      userEmail: formData.email || "zoomtest@test.com",
      passWord: meetingData.password,
      success: () => console.log("Joined meeting successfully"),
      error: (err) => setError(err.message || "Failed to join meeting"),
    });
  },
  error: (err) => setError(err.message || "Failed to initialize Zoom"),
});

```

SDK initialization:

```auto
useEffect(() => {
  if (isSdkLoaded && window.ZoomMtg) {
    window.ZoomMtg.setZoomJSLib(" ***//source.zoom.us/3.12.0/lib***", "/av");
    window.ZoomMtg.preLoadWasm();
    window.ZoomMtg.prepareWebSDK();
  }
}, [isSdkLoaded]);

```

#### Backend (Laravel with Zoom API)

- I’m using the Zoom Server-to-Server OAuth flow to generate an access token and create meetings.
- I generate a signature for the Meeting SDK using JWT.
- Relevant code (ZoomService.php): php:

```auto
public function createMeeting(array $data): array {
  $response = Http::withHeaders([
    'Authorization' => 'Bearer ' . $this->getAccessToken(),
    'Content-Type' => 'application/json',
  ])->post(' ***//api.zoom.us/v2/users/me/meetings***', [
    'topic' => $data['title'],
    'type' => 2,
    'start_time' => Carbon::parse($data['start_time'])->toIso8601String(),
    'duration' => $data['duration'],
    'timezone' => $data['timezone'],
  ]);
  return $response->json();
}

public function generateSignature(string $meetingNumber, int $role): string {
  $sdkKey = env('ZOOM_CLIENT_ID');
  $sdkSecret = env('ZOOM_CLIENT_SECRET');
  $iat = time() - 30;
  $exp = $iat + 60 * 60 * 2;
  $payload = [
    'sdkKey' => $sdkKey,
    'mn' => $meetingNumber,
    'role' => $role,
    'iat' => $iat,
    'exp' => $exp,
    'tokenExp' => $exp,
  ];
  return JWT::encode($payload, $sdkSecret, 'HS256');
}

```

### The Issue

- I can successfully register/login and create a meeting (meeting ID is returned).
- However, when I attempt to start/join the meeting:
  - The ZoomMtg.init callback fires successfully, but ZoomMtg.join throws an error like “invalid signature” error code “3172”.

- Logs show the signature and meeting data being fetched, but the meeting doesn’t launch in the browser.

### What I’ve Tried

- Verified SDK Key, Client ID, Client Secret, and access token generation.
- Ensured the meeting ID and signature are correctly passed from backend to frontend.
- Tested with different roles (host=1, participant=0).
- Checked network requests—no obvious CORS or API errors.

### Questions

1. Is there an issue with how I’m initializing or using the Zoom Web API in Next.js?
2. Could the signature generation on the backend be incorrect? Should ZOOM\_CLIENT\_ID be used as sdkKey, or do I need a separate SDK key?
3. Are there any common pitfalls with Zoom Meeting SDK 3.12.0 that I might be missing?

Any help narrowing down whether this is a frontend, backend, or Zoom configuration issue would be greatly appreciated. I can provide more logs or details if needed. Thank you! Please note that all the url values here were modified removing https to be able to post

---

<div class="post-metadata">

**Author:** ![expertswho](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/expertswho/32/60945_2.png) [@expertswho](https://devforum.zoom.us/u/expertswho)\
**Post date:** [April 9, 2025, 9:15am UTC](https://devforum.zoom.us/t/invalid-signature-issue/131217/2 "2025-04-09T09:15:54Z")

</div>

hi @mohamed4 ,  
you can not run on a local url.  
Use something like ngrok to give you an external public url while you develop.  
all the best

John

---

<div class="post-metadata">

**Author:** ![mohamed4](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mohamed4/32/55226_2.png) [@mohamed4](https://devforum.zoom.us/u/mohamed4)\
**Post date:** [April 9, 2025, 9:24am UTC](https://devforum.zoom.us/t/invalid-signature-issue/131217/3 "2025-04-09T09:24:37Z")

</div>

Hi [John Drinkwater MVP].

Thank you so much for taking the time to reply—I really appreciate your suggestion and the help from an MVP like yourself!

I should clarify: my backend is deployed on a live server, but my frontend is still running locally on localhost:3000. I’ve set the leaveUrl to the local URL for development purposes, and I don’t believe this should affect the Zoom Meeting SDK’s ability to join a meeting, since the signature and meeting data are fetched from the live backend. However, I’m still encountering the “invalid signature” error (code 3172) when calling ZoomMtg.join.

Thanks again for your guidance

---

<div class="post-metadata">

**Author:** ![expertswho](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/expertswho/32/60945_2.png) [@expertswho](https://devforum.zoom.us/u/expertswho)\
**Post date:** [April 9, 2025, 9:35am UTC](https://devforum.zoom.us/t/invalid-signature-issue/131217/4 "2025-04-09T09:35:46Z")

</div>

hi @mohamed4

you CAN NOT use localhost.  
authorisation is done between your app and [Zoom.us](http://Zoom.us) and so any local url will never see the result and fail!

All the best

John

---

<div class="post-metadata">

**Author:** ![mohamed4](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mohamed4/32/55226_2.png) [@mohamed4](https://devforum.zoom.us/u/mohamed4)\
**Post date:** [April 10, 2025, 7:48am UTC](https://devforum.zoom.us/t/invalid-signature-issue/131217/5 "2025-04-10T07:48:53Z")

</div>

Hello @ John Drinkwater MVP  
Again thank you for giving me some of your time to try to fix my issue  
I’ve taken your advice and set my front end test sample project online but I’m still facing the same issue (invalid signature)  
Here is the link to my project  
zoom-test-rho.vercel.app/?code=XINJS2Cl0HUNPvzcOPgQo2N6pV2s9ojxg

- Notice that I’ve generated this link from Zoom itself creating Authorization URL
- Also I’ve removed adding https because I can’t add links on here

Again, Thank you very much

---

<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:** [April 10, 2025, 5:16pm UTC](https://devforum.zoom.us/t/invalid-signature-issue/131217/6 "2025-04-10T17:16:41Z")

</div>

Hi @mohamed4 ,

This may be helpful to look at as well:

> [@Unable to join meeting, "Invalid sdkkey." error](https://devforum.zoom.us/t/unable-to-join-meeting-invalid-sdkkey-error/130694/3):
>
> Hi @ScottL we do, however there are many threads with this topic with solutions. Have you down a search on the forum? There are a number of potential root causes. Check out the following as well: [https://youtu.be/F3l5RJoEKP4?si=2h8KwBml8Harw-AF](https://youtu.be/F3l5RJoEKP4?si=2h8KwBml8Harw-AF)[https://youtu.be/SjlnjL0afKI?si=b9erbEDfT3WfxJAo](https://youtu.be/SjlnjL0afKI?si=b9erbEDfT3WfxJAo)[Troubleshooting Meeting SDK signature validation](https://developers.zoom.us/blog/troubleshooting-meeting-sdk-signature-validation/)
