/session/token - Invalid Checksum Error in Java

MeetPatel
MeetPatel edited April 2022 in General
Hi Team,

I'm trying to get the access token with /session/token API and getting the following error:
403 Forbidden: [{"status":"error","message":"Invalid `checksum`.","data":null,"error_type":"TokenException"}]"

I'm aware of the Java Client but we're not planning to use it currently. I'm making a call directly to the /session/token API.

I'm generating checksum with HmacSHA256 in Java as follows:
Mac sha256_HMAC = Mac.getInstance(Constants.HMAC_SHA_256);
SecretKeySpec secret_key = new SecretKeySpec(apiSecret.getBytes(), Constants.HMAC_SHA_256);
sha256_HMAC.init(secret_key);
/* message = api_key + request_token + api_secret */
byte[] hash = sha256_HMAC.doFinal(message.getBytes());
String checksum = Hex.encodeHexString(hash);

I tried to figure out how java client is generating this checksum but couldn't find anything. Could you please help me figure out what am I doing wrong?
This discussion has been closed.