docusign中的apiClient.RequestJWTUserToken不起作用 [英] apiClient.RequestJWTUserToken in docusign doesn't work

查看:106
本文介绍了docusign中的apiClient.RequestJWTUserToken不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DocuSign C#SDK创建一个JWT令牌,以使用Integrator密钥模拟为用户,但它抛出错误:

I'm using DocuSign C# SDK to create a JWT token to impersonate as a user using an Integrator key but it throws an error saying:

请求服务器时出错,收到不成功的HTTP代码

我只是调用 UpdateToken()方法,如下所示:

I'm simply calling the UpdateToken() method which is like this:

 private static void UpdateToken()
        {
            var apiClient = new ApiClient();

            OAuth.OAuthToken authToken = apiClient.RequestJWTUserToken(ClientID, ImpersonatedUserGuid, AuthServer, Encoding.ASCII.GetBytes(PrivateKey), TokenExpiryInHours, new List<string> { "signature", "impersonation" });

            AccessToken = authToken.access_token;

            TokenExpiryTime = DateTime.Now.AddSeconds(authToken.expires_in.Value);
        }

RequestJWTUserToken 中传递的所有参数的

值是:

values for all the parameters passed in RequestJWTUserTokenare:

 "DocuSign": {       
    "ClientID": "aff67220-XXXX-XXXX-XXXX-426b6575c3bd",
    "ImpersonatedUserGuid": "f9a0f822-XXXX-XXXX-XXXX-7a576f06df81",
    "AuthServer": "https://account-d.docusign.com",
    "TokenReplacementTimeInSeconds": "600",
    "TokenExpiryInHours": "1",
    "PrivateKey": "-----BEGIN RSA PRIVATE KEY-----\r\XXXXXXX\r\n-----END RSA PRIVATE KEY-----"
  }

我已通过使用此端点征得了用户的同意:

I have taken the consent from the user by using this endpoint:

https://account-d.docusign.com/oauth/auth ?response_type = token& scope = signature%20impersonation& client_id = aff67220-3ca7-4de7-8556-426b6575c3bd& redirect_uri = https://www.vava.cars/tr/admin

https://account-d.docusign.com/oauth/auth? response_type=token&scope=signature%20impersonation&client_id=aff67220-3ca7-4de7-8556-426b6575c3bd &redirect_uri=https://www.vava.cars/tr/admin

,并且用户已成功允许此clientId/integrator密钥具有权限.

and the user has successfully allowed this clientId/integrator key to have the permissions.

我不知道我在做什么错.

I don't know what I am doing wrong here.

推荐答案

对于 Audience 值(代码中的 AuthServer ),您需要删除https://前缀,并将其设置为 account-d.docusign.com

For the Audience value (AuthServer in your code), you need to drop the https:// prefix and set that to account-d.docusign.com

这篇关于docusign中的apiClient.RequestJWTUserToken不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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