一小时后Docusign API失败 [英] Docusign API's failing after an hour

查看:82
本文介绍了一小时后Docusign API失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个docusign-sandbox帐户。我正在尝试将docusign与我的应用程序集成,并在Java中使用JWT Grant进行身份验证。我从 https://github.com/docusign/eg-01-java-jwt 获得了一个示例代码,它可以完美工作一个小时然后API开始失败。

I have a docusign-sandbox account. I am trying to integrate docusign with my application and am using JWT Grant for authentication in java. I got a sample code from https://github.com/docusign/eg-01-java-jwt and it works perfectly for an hour and then the API starts failing.

有什么办法可以解决这个问题吗?

Any idea how I can tackle this issue?

我得到了以下错误

我已经尝试将令牌的到期时间从1小时更改为其他较小的值(5分钟,30分钟)。即使这样,一个小时后API也会开始完全失败。

I already tried changing the Token expiry time from 1hr to other lesser values(5 min, 30 min). Even then the APIs start failing exactly after an hour.

https://github.com/docusign/eg-01-java-jwt

错误消息

{"timestamp":1560750467288,"status":500,"error":"Internal Server Error","message":"Error while requesting server, received a non successful HTTP code 401 with response Body: '{\r\n  \"errorCode\": \"USER_AUTHENTICATION_FAILED\",\r\n  \"message\": \"One or both of Username and Password are invalid. Invalid access token\"\r\n}'","path":"{path}"}


推荐答案

找到了解决问题的方法。

Found a way around the problem.

正在生成访问令牌,但由于某种原因,它并未生成更新ApiClient对象中的令牌,并且仅使用旧令牌。
因此,现在每次令牌过期时,我都只是创建一个新的ApiClient对象,而不是用新令牌替换旧令牌。

The access token was being generated but for some reason it was not updating the token in the ApiClient Object and was using the old token only. So now I am just creating a new ApiClient Object every time the token expires instead of replacing the old token with the new one.

这篇关于一小时后Docusign API失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆