The signature has expired while error using JAVA jwt

Description
Hi team,
I am using JAVA-JWT to generate signatures in the backend and passing them to the client, but we are getting an error The signature has expired
Please help me resolve this issue. I have added a few details below:

Browser Console Error
— errorCallBack —
{method: ‘join’, status: false, result: ‘The signature has expired.’, errorMessage: ‘The signature has expired.’, errorCode: 3705}

Which Web Meeting SDK version?
2.12.2

Meeting SDK Code Snippets
**Server Side **

val header = Map(
	"alg" -> "HS256",
	"typ" -> "JWT"
)

val currentTime = System.currentTimeMillis()
val expTime = (currentTime + 86400000).toString //24 * 60 * 60 * 1000=  HR * MIN * SEC * milliseconds


val jwt = JWT.create()
	.withHeader(JavaConverters.mapAsJavaMap(header))
	.withClaim("appKey", ZOOM_SDK_API_KEY)
	.withClaim("sdkKey", ZOOM_SDK_API_KEY)
	.withClaim("mn", meetingId)
	.withClaim("role", 1)
	.withClaim("iat", currentTime.toString)
	.withClaim("exp", expTime)
	.withClaim("tokenExp", expTime)


jwt.sign(Algorithm.HMAC256(ZOOM_SDK_API_SECRET))
ZoomMtg.init({
			debug: !isProduction,
			disableInvite:true,
			isSupportAV: true,
			success: function(res) {
				ZoomMtg.join({
					meetingNumber: meetingConfig.meetingNumber,
					userName: meetingConfig.userName,
					signature: meetingConfig.signature,
					sdkKey: meetingConfig.sdkKey,
					userEmail: meetingConfig.userEmail,
					passWord: meetingConfig.passWord,
					tk:meetingConfig.token
				})
			}
		});

Screenshots

Troubleshooting Routes
The troubleshooting attempt types you’ve already exhausted, including testing with the appropriate sample app (found on Zoom · GitHub).

Device (please complete the following information):

  • Device: Dell
  • OS: Ubuntu 22.0
  • Browser: Chrome
  • Browser Version 113.0.5672.126 (Official Build) (64-bit)

Additional context
Add any other context about the problem here.

iat, exp, tokenExp must be defined in seconds (not milliseconds)

https://developers.zoom.us/docs/meeting-sdk/auth/#sample-code

here you can check your signature

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