Hi,
I am getting the following error while sending the JWT Token request to https://api.box.com/oauth2/token
Error:
"{"error":"invalid_grant","error_description":"Please check the 'exp' claim."}"
Solution:
long DEVIDE=1000L;
long currentTime=System.currentTimeMillis();
long seconds=(currentTime/DEVIDE);
seconds=seconds+60L;
Map<String, Object> claims= new HashMap<String,Object>();
claims.put("iss", CLIENT_ID);
claims.put("sub", SUBJECT_ID);
claims.put("box_sub_type", "user");
claims.put("aud", "https://api.box.com/oauth2/token");
claims.put("jti", UUID.randomUUID());
long currentTime=System.currentTimeMillis();
long seconds=(currentTime/DEVIDE);
seconds=seconds+60l;
claims.put("exp",seconds);
After modifying the code issue will be resolved.
I am getting the following error while sending the JWT Token request to https://api.box.com/oauth2/token
Error:
"{"error":"invalid_grant","error_description":"Please check the 'exp' claim."}"
Solution:
long DEVIDE=1000L;
long currentTime=System.currentTimeMillis();
long seconds=(currentTime/DEVIDE);
seconds=seconds+60L;
Map<String, Object> claims= new HashMap<String,Object>();
claims.put("iss", CLIENT_ID);
claims.put("sub", SUBJECT_ID);
claims.put("box_sub_type", "user");
claims.put("aud", "https://api.box.com/oauth2/token");
claims.put("jti", UUID.randomUUID());
long currentTime=System.currentTimeMillis();
long seconds=(currentTime/DEVIDE);
seconds=seconds+60l;
claims.put("exp",seconds);
After modifying the code issue will be resolved.
Definitely not Doing all of your Component The right way https://imgur.com/a/hqTHXi5 https://imgur.com/a/LPXLQz9 https://imgur.com/a/fls9k2S https://imgur.com/a/d5uKm5b https://imgur.com/a/D5OdGyn http://vaqiikov39.dip.jp https://imgur.com/a/UtOrl6b
ReplyDelete