Yes, this is an existing, recurring meeting setup on the account which I’m using to test with. I can join the meeting using the same details as I’m passing into the SDK via the desktop app.
Public Overridable Function ZoomGetSignature(config As ZoomMeetingConfig) As GenericResult
Dim result As New GenericResult
'' get timestamp
Dim ts As String = (ToTimestamp(DateTime.UtcNow.ToUniversalTime()) - 30000).ToString()
result.Data = CreateToken(config.ApiKey, config.MeetingNumber, ts, config.Role)
result.Success = True
Return result
End Function
Private Function ToTimestamp(ByVal value As DateTime) As Long
Dim epoch As Long = (value.Ticks - 621355968000000000) / 10000
Return epoch
End Function
Private Function CreateToken(ByVal apiKey As String, ByVal meetingNumber As String, ByVal ts As String, ByVal role As String) As String
Dim padding() As Char = {"="}
Dim message As String = String.Format("{0}{1}{2}{3}", apiKey, meetingNumber, ts, role)
Dim encoding As New System.Text.ASCIIEncoding()
Dim keyByte() As Byte = encoding.GetBytes(apiSecret)
Dim messageBytesTest() As Byte = encoding.GetBytes(message)
Dim msgHashPreHmac As String = System.Convert.ToBase64String(messageBytesTest)
Dim messageBytes() As Byte = encoding.GetBytes(msgHashPreHmac)
Dim token As String
Using hmacsha256 As New HMACSHA256(keyByte)
Dim hashmessage() As Byte = hmacsha256.ComputeHash(messageBytes)
Dim msgHash As String = System.Convert.ToBase64String(hashmessage)
token = String.Format("{0}.{1}.{2}.{3}.{4}", apiKey, meetingNumber, ts, role, msgHash)
Dim tokenBytes = System.Text.Encoding.UTF8.GetBytes(token)
token = System.Convert.ToBase64String(tokenBytes).TrimEnd(padding)
End Using
Return token
End Function
And now I seem to be getting “Your connection has timed out and you cannot join the meeting. Verify your network connectivity and try again.” Using the same code. No changes.
I doubt my network is actually the issue as I have no issue connecting to zoom meetings with the Zoom Web client on your site.
Dim epoch As Long = value.Ticks / TimeSpan.TicksPerMillisecond
I get “The Signature has Expired”, when I use the code for the timestamp in the example, I get the other error “Your connection has timed out and you cannot join the meeting. Verify your network connectivity and try again.”
And when I use the JS GenerateSignature method, I can connect to the meeting.
There was a role mismatch, which was causing the error. It would be helpful if perhaps a more specific error was provided when the role used in the hash doesn’t match what is used in the final encode.