# Signature has Expired

**URL:** <https://devforum.zoom.us/t/signature-has-expired/2656>\
**Category:** Web\
**Created:** [December 5, 2018, 12:11pm UTC](https://devforum.zoom.us/t/signature-has-expired/2656 "2018-12-05T12:11:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Class\_11](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@Class\_11](https://devforum.zoom.us/u/Class_11)\
**Post date:** [December 5, 2018, 12:11pm UTC](https://devforum.zoom.us/t/signature-has-expired/2656/1 "2018-12-05T12:11:32Z")

</div>

Hi ,

1. I am getting this error that the signature has expired.Some times it works like a charm ,But some time it show me msg that signature has expired.It is happening on the same system, same browser.

2. On some people system it works but on some people system it don’t works and show me an error that the signature has expired.

3. The account which I am using (The API key and the Secret Key) are of purchased account.

4. I have gone through all the post related to the signature has expired and tried to implement them but still the issue persist.

5. I cannot deploy this integration on production because this error can occurs on the client system as well and it will be a blocker for me.

Please help me in resolving this issue.

---

<div class="post-metadata">

**Author:** ![shahar](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@shahar](https://devforum.zoom.us/u/shahar)\
**Post date:** [December 6, 2018, 10:46am UTC](https://devforum.zoom.us/t/signature-has-expired/2656/2 "2018-12-06T10:46:28Z")

</div>

Looking forward for a solution, too!

---

<div class="post-metadata">

**Author:** ![JackYang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jackyang/32/1135_2.png) [@JackYang](https://devforum.zoom.us/u/JackYang)\
**Post date:** [December 13, 2018, 9:57am UTC](https://devforum.zoom.us/t/signature-has-expired/2656/3 "2018-12-13T09:57:10Z")

</div>

@Class_11 @shahar  
Sorry about that. this issue because of the time. the first sync system time. Try to use success callback fun to ensure signature generate success.

```
ZoomMtg.generateSignature({
        meetingNumber: meetConfig.meetingNumber,
        apiKey: meetConfig.apiKey,
        apiSecret: meetConfig.apiSecret,
        role: meetConfig.role,
        success(res) {
            console.log('signature', res.result);
            ZoomMtg.init({
                leaveUrl: 'http://www.zoom.us',
                success() {
                    ZoomMtg.join(
                        {
                            meetingNumber: meetConfig.meetingNumber,
                            userName: meetConfig.userName,
                            signature: res.result,
                            apiKey: meetConfig.apiKey,
                            userEmail: '',
                            passWord: '',
                            success() {
                             
                                console.log('join meeting success');
                            },
                            error(res) {
                                console.log(res);
                            }
                        }
                    );
                },
                error(res) {
                    console.log(res);
                }
            });
        }
    });

// here is a simple code generateSignature with es6 statements
// npm install --save-dev js-base64 crypto-js
import * as base64JS from 'js-base64';
import * as hmacSha256 from 'crypto-js/hmac-sha256';
import * as encBase64 from 'crypto-js/enc-base64';

function generateSignature(data) {
	let signature = '';
	const ts = new Date().getTime();
	try {
		const msg = base64JS.Base64.encode(data.apiKey + data.meetingNumber + ts + data.role);
		const hash = hmacSha256.default(msg, data.apiSecret);
		signature = base64JS.Base64.encodeURI(`${data.apiKey}.${data.meetingNumber}.${ts}.${data.role}.${encBase64.stringify(hash)}`);
	} catch (e) {
		console.log('error');
	}
	return signature;
}
```

---

<div class="post-metadata">

**Author:** ![shahar](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@shahar](https://devforum.zoom.us/u/shahar)\
**Post date:** [December 13, 2018, 10:02pm UTC](https://devforum.zoom.us/t/signature-has-expired/2656/4 "2018-12-13T22:02:39Z")

</div>

Thanks,  
However I’m generating the signature server side and render it to the page:

```auto
$(function(){
      ZoomMtg.init({
          leaveUrl: 'http://mysite.com',
          isSupportAV: true,
          success: function () {
              ZoomMtg.join(
                  {
                      meetingNumber: <%=meeting_number%>,
                      userName: '<%=user.email%>',
                      userEmail: '<%=user.email%>',
                      signature: '<%=signature%>',
                      apiKey: '<%=config.get('zoom.api_key')%>',
                      success: function(res){
                          console.log('join meeting success');
                      },
                      error: function(err){
                        console.log(err)
                      }
                  }
              );
          }
      });
    })

```

So I do I imply the same method you mentioned on server generated signatures? or another solution? and what exactly is the problem with the time, just curious?

---

<div class="post-metadata">

**Author:** ![JackYang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jackyang/32/1135_2.png) [@JackYang](https://devforum.zoom.us/u/JackYang)\
**Post date:** [December 18, 2018, 1:36am UTC](https://devforum.zoom.us/t/signature-has-expired/2656/5 "2018-12-18T01:36:30Z")

</div>

it’s a bad way to generate signatures on the browser side. We haven’t found the root cause.

> **[Generate Signature - Tutorial - Web Client SDK - Software Development Kit (SDK)](https://marketplace.zoom.us/docs/sdk/Web-Client-SDK/tutorial/generate-signature)**
>
> Generate Signature
> 
> Below are code snippets to generate a signature using backend services.

  
here is sample code generated signatures on server side.

---

<div class="post-metadata">

**Author:** ![shahar](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@shahar](https://devforum.zoom.us/u/shahar)\
**Post date:** [December 18, 2018, 6:28pm UTC](https://devforum.zoom.us/t/signature-has-expired/2656/6 "2018-12-18T18:28:59Z")

</div>

I underdtand that and I’m already generating signatures on the server side, no problem with that. My question is how to overcome the “signature expired” bug when generating the signature server side.

---

<div class="post-metadata">

**Author:** ![vincent.engelmann1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vincent.engelmann1/32/975_2.png) [@vincent.engelmann1](https://devforum.zoom.us/u/vincent.engelmann1)\
**Post date:** [May 29, 2019, 2:13pm UTC](https://devforum.zoom.us/t/signature-has-expired/2656/7 "2019-05-29T14:13:34Z")

</div>

I saw a small hint of something in what @JackYang wrote:

> Sorry about that. this issue because of the time. the first sync system time.

I tried passing the epoch time of the browser back to my API that’s doing generateSignature() (e.g. instead of generating the time in epochs in the backend, I pass what the browser has back to it), and that got it working!

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [May 12, 2021, 10:51pm UTC](https://devforum.zoom.us/t/signature-has-expired/2656/8 "2021-05-12T22:51:30Z")

</div>

To see code samples and a sample app to generate the Web SDK Signature, checkout our docs:

> **[Generate Signature - Build an App - Web - Client SDKs - Zoom Software...](https://marketplace.zoom.us/docs/sdk/native-sdks/web/build/signature)**
>
> Generate Signature
> 
> Each request to start or join a meeting / webinar must be verified by an encrypted signature authorizing each user to enter. A signa...

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [May 12, 2021, 10:51pm UTC](https://devforum.zoom.us/t/signature-has-expired/2656/9 "2021-05-12T22:51:37Z")

</div>

Closed on May 12, 2021, 10:51pm UTC


