Hi, Carson:
I used below payload:
{
“appKey”: “string”//SDK key
“iat”: 1597028327962, //milliseconds. System.currentTimeMillis()
“exp”: 1597114727962, //milliseconds.System.currentTimeMillis()+2460601000
“tokenExp”: 1597114727962 //milliseconds.System.currentTimeMillis()+2460601000
}
BTW, I also tried to calculate the JWT from java codes with io.jsonwebtoken.Jwts. But, I found the result is different from the one i generated from [https://jwt.io/#libraries-io] with same input. Pls advise it. See below codes in java
public static void main(String args)throws Exception{
long timestamp = System.currentTimeMillis();
Date(2020,8,7).getTime();
System.out.println(timestamp);
System.out.println(timestamp+246060*1000);
Map<String, Object> header = new HashMap();
header.put(“alg”,“HS256”);
header.put(“typ”, “JWT”);
Map<String, Object> payload = new HashMap();
payload.put(“appKey”, _SDK_KEY);
payload.put(“iat”, timestamp);
payload.put(“exp”, timestamp);
payload.put(“tokenExp”, timestamp);
//SecretKey key = Keys.hmacShaKeyFor(Decoders.BASE64URL.decode(_SDK_SEC));
SecretKey key = Keys.hmacShaKeyFor(_SDK_SEC.getBytes(StandardCharsets.UTF_8));
String token = Jwts.builder().setHeader(header).setClaims(payload).signWith(key, SignatureAlgorithm.HS256)
.compact();
System.out.println(token);
}
May I know what is the encoding format of the generated SDK secret from zoom SDK app?