我在我的 laravel 项目中集成了 docusign 远程签名。它工作正常,但不幸的是,从前两天开始,当我尝试请求 JWT 用户令牌时,相同的代码在实时服务器上抛出错误。
错误是..
API call to https://account.docusign.com/oauth/token failed, but for an unknown reason. This could happen if you are disconnected from the network.
这是出现错误的代码..
private function getToken(ApiClient $apiClient): string
{
try {
$privateKey = \File::get(storage_path(env('DS_KEY_PATH')));
$response = $apiClient->requestJWTUserToken(
$ikey = env('DS_CLIENT_ID'),
$userId = env('DS_IMPERSONATED_USER_ID'),
$key = $privateKey,
$scope = env('DS_JWT_SCOPE')
);
$token = $response[0];
$accessToken = $token->getAccessToken();
} catch (\Throwable $th) {
dd($th->getMessage());
throw $th;
}
return $accessToken;
}
出现错误的主要点是这段代码..
$response = $apiClient->requestJWTUserToken(
$ikey = env('DS_CLIENT_ID'),
$userId = env('DS_IMPERSONATED_USER_ID'),
$key = $privateKey,
$scope = env('DS_JWT_SCOPE')
);