launcher-csharp 演示中的 JWT 流程
JWT flow in launcher-csharp demo
我正在玩来自 DocuSign GitHub 的 launcher-csharp 演示。它适用于授权代码授予流程。但是当我尝试 运行 JWT 流时,在这个调用中抛出异常:
public void UpdateUserFromJWT()
{
this._authToken = _apiClient.RequestJWTUserToken(
this._configuration["DocuSignJWT:ClientId"],
this._configuration["DocuSignJWT:ImpersonatedUserId"],
this._configuration["DocuSignJWT:AuthServer"],
DSHelper.ReadFileContent(DSHelper.PrepareFullPrivateKeyFilePath(this._configuration["DocuSignJWT:PrivateKeyFile"])),
1);
异常表示服务器返回了 "consent_required" 错误。
“How to get an access token with JWT Grant”文档部分中的错误描述说,这意味着用户没有同意,这不是我的情况,或者 URI 配置有问题。我仔细检查了 appsettings.Development.json.
中的 DocuSignJWT 部分
- “ClientId” 是从该应用程序设置中的“集成密钥”字段复制而来的。它与用于授权码授予流程的相同。
- “ImpersonatedUserId” 是从“用户 ID”字段复制的。相同的值在用户编辑表单的“API 用户名”字段中。 运行在授权代码授予流程中,在用户“子”字段中返回了相同的值。
- "AuthServer": "账户-d.docusign.com".
- “PrivateKeyFile” 是文件名,此应用程序的私钥按原样存储,带有“-----BEGIN RSA PRIVATE KEY-----”和“-----结束 RSA 私钥-----”。
显然我做错了什么,但是什么?
您必须先同意 JWT。
https://account-d.docusign.com/oauth/auth?
response_type=code
&scope=signature%20impersonation
&client_id=your integration key
&redirect_uri=your **encoded** callback url from the ikey settings
例如“https%3A%2F%2Flocalhost%3A9090%2Fds%2Fcallback”。
我正在玩来自 DocuSign GitHub 的 launcher-csharp 演示。它适用于授权代码授予流程。但是当我尝试 运行 JWT 流时,在这个调用中抛出异常:
public void UpdateUserFromJWT()
{
this._authToken = _apiClient.RequestJWTUserToken(
this._configuration["DocuSignJWT:ClientId"],
this._configuration["DocuSignJWT:ImpersonatedUserId"],
this._configuration["DocuSignJWT:AuthServer"],
DSHelper.ReadFileContent(DSHelper.PrepareFullPrivateKeyFilePath(this._configuration["DocuSignJWT:PrivateKeyFile"])),
1);
异常表示服务器返回了 "consent_required" 错误。 “How to get an access token with JWT Grant”文档部分中的错误描述说,这意味着用户没有同意,这不是我的情况,或者 URI 配置有问题。我仔细检查了 appsettings.Development.json.
中的 DocuSignJWT 部分- “ClientId” 是从该应用程序设置中的“集成密钥”字段复制而来的。它与用于授权码授予流程的相同。
- “ImpersonatedUserId” 是从“用户 ID”字段复制的。相同的值在用户编辑表单的“API 用户名”字段中。 运行在授权代码授予流程中,在用户“子”字段中返回了相同的值。
- "AuthServer": "账户-d.docusign.com".
- “PrivateKeyFile” 是文件名,此应用程序的私钥按原样存储,带有“-----BEGIN RSA PRIVATE KEY-----”和“-----结束 RSA 私钥-----”。
显然我做错了什么,但是什么?
您必须先同意 JWT。
https://account-d.docusign.com/oauth/auth?
response_type=code
&scope=signature%20impersonation
&client_id=your integration key
&redirect_uri=your **encoded** callback url from the ikey settings
例如“https%3A%2F%2Flocalhost%3A9090%2Fds%2Fcallback”。