开发者社区> 问答> 正文

关于钉钉回调接口解密失败


接口是
https://oapi.dingtalk.com/call_back/register_call_back?access_token=xxx
发送内容

{
    "call_back_tag": ["user_add_org", "user_modify_org", "user_leave_org"],
    "token": "123456",
    "aes_key": "1234567891234567891234567891234567891234567",
    "url":"http://150917jq43.iask.in/demo/eventreceive"
}


成功回调了我的url,但是却一直解密失败,求解,程序里面写的token和aeskey和这里发送过去的一致,代码是下载java demo里面的。异常提示的是com.cy.module.dingding.DingTalkEncryptException.COMPUTE_DECRYPT_TEXT_ERROR,计算解密文字错误。

展开
收起
blinnn 2016-05-24 16:17:42 18769 0
4 条回答
写回答
取消 提交回答
  • Re关于钉钉回调接口解密失败
    2018-03-02 11:02:41
    赞同 展开评论 打赏
  • 回 2楼竹梅的帖子
    替换了还是出错
    com.dingtalk.oapi.lib.aes.DingTalkEncryptException: 计算解密文字错误
            at com.dingtalk.oapi.lib.aes.DingTalkEncryptor.decrypt(DingTalkEncryptor.java:149)
            at com.dingtalk.oapi.lib.aes.DingTalkEncryptor.getDecryptMsg(DingTalkEncryptor.java:94)
            at com.dingtalk.isv.access.web.controller.suite.callback.SuiteCallBackController.receiveCallBack(SuiteCallBackController.java:74)
            at com.dingtalk.isv.access.web.controller.suite.callback.SuiteCallBackController$$FastClassBySpringCGLIB$$8ac1ce8d.invoke(<generated>)
            at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
            at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:700)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
            at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
            at com.dingtalk.isv.access.web.interceptor.ControllorAOP.handler(ControllorAOP.java:46)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
            at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
            at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
            at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:633)
            at com.dingtalk.isv.access.web.controller.suite.callback.SuiteCallBackController$$EnhancerBySpringCGLIB$$c446864e.receiveCallBack(<generated>)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
            at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
            at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
            at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
            at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
            at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
            at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
            at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
            at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
            at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
            at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
            at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
            at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
            at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
            at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
            at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
            at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
            at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
            at java.lang.Thread.run(Thread.java:748)

    2018-02-12 15:43:06
    赞同 展开评论 打赏
  • 回 楼主(blinnn) 的帖子
    加解密要替换本地的加解密库,详见文档
    http://g.alicdn.com/dingding/opendoc/docs/_isvguide/tab5.html?t=1464078310753#加解密库和demo下载;
    回调接口注册只需注册一次就可以
    2016-05-24 20:39:01
    赞同 展开评论 打赏
  • Re关于钉钉回调接口解密失败
    再问一个问题,这个注册回调接口只要请求一次就永久有效是吗?
    2016-05-24 16:26:55
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
钉钉小程序——为工作方式插上翅膀 立即下载
钉钉客户端自动化的应用 立即下载
使命必达 —— 钉钉企业级 消息服务的机遇与挑战 立即下载