We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题。我们在使用事件回调和卡片消息回调时同样的key和token,一个能通过校验,一个不能。通过排查,发现两个方法SDK的签名验证逻辑的代码不一样,一个用的是key,一个用的token
` private boolean verifySign(EventReq eventReq) throws NoSuchAlgorithmException { if (Strings.isEmpty(verificationToken)) { return true; }
String cipherEventJsonStr = new String(eventReq.getBody(), StandardCharsets.UTF_8); String timestamp, nonce, sourceSign, targetSign; timestamp = eventReq.getHeaderFirstValue(Constants.X_LARK_REQUEST_TIMESTAMP); nonce = eventReq.getHeaderFirstValue(Constants.X_LARK_REQUEST_NONCE); sourceSign = eventReq.getHeaderFirstValue(Constants.X_LARK_SIGNATURE); targetSign = calculateSignature(timestamp, nonce, verificationToken, cipherEventJsonStr); return targetSign.equals(sourceSign); }`
`private boolean verifySign(EventReq eventReq) throws NoSuchAlgorithmException { if (Strings.isEmpty(encryptKey)) { return true; }
String cipherEventJsonStr = new String(eventReq.getBody(), StandardCharsets.UTF_8); String timestamp, nonce, sourceSign, targetSign; timestamp = eventReq.getHeaderFirstValue(Constants.X_LARK_REQUEST_TIMESTAMP); nonce = eventReq.getHeaderFirstValue(Constants.X_LARK_REQUEST_NONCE); sourceSign = eventReq.getHeaderFirstValue(Constants.X_LARK_SIGNATURE); targetSign = calculateSignature(timestamp, nonce, encryptKey, cipherEventJsonStr); return targetSign.equals(sourceSign); }`
使用key的可以通过校验,使用token的不能通过。我理解两个事件应该是一样的处理鉴权的逻辑,有人能帮忙看看吗?
The text was updated successfully, but these errors were encountered:
我也遇到类似问题,通过订阅旧版本回调解决了
Sorry, something went wrong.
No branches or pull requests
如题。我们在使用事件回调和卡片消息回调时同样的key和token,一个能通过校验,一个不能。通过排查,发现两个方法SDK的签名验证逻辑的代码不一样,一个用的是key,一个用的token
` private boolean verifySign(EventReq eventReq) throws NoSuchAlgorithmException {
if (Strings.isEmpty(verificationToken)) {
return true;
}
`private boolean verifySign(EventReq eventReq) throws NoSuchAlgorithmException {
if (Strings.isEmpty(encryptKey)) {
return true;
}
使用key的可以通过校验,使用token的不能通过。我理解两个事件应该是一样的处理鉴权的逻辑,有人能帮忙看看吗?
The text was updated successfully, but these errors were encountered: