如何解决如何使用asp.net获取Authorization_code和access_Token并发送信封DocuSign
我正在尝试使用 docuSign 发送信封,但在获取 authorization_code
时出错,需要获取 access_Token
。
请帮我获取 authorization_Code
和 access_Token
。
我使用的是 ASP.Net 网页表单和 .NET 框架 4.5.2
- DocuSign.eSign.dll 5.2.0
- DocuSign.Integration.Client.dll 1.7.2
请求:
https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature&client_id=4f464e25-6425-4ea6-915b-aa9bac5b8ce7&redirect_uri=https://account-d.docusign.com/ds/login?authType=JWT
回复:
The redirect redirect_uri is not registered properly with DocuSign
string RedirectURI = "https://account-d.docusign.com/ds/login?authType=JWT";
string ClientSecret = "****";
string IntegratorKey = "****";
Uri oauthLoginUrl = GetAuthorizationUri(IntegratorKey,scopes,RedirectURI,OAuth.CODE,null);
WebRequest request = WebRequest.Create(oauthLoginUrl);
WebResponse response = request.GetResponse();
public Uri GetAuthorizationUri(string clientId,List<string> scopes,string redirectUri,string responseType,string state = null)
{
string formattedScopes = (scopes == null || scopes.Count < 1) ? "" : scopes[0];
StringBuilder scopesSb = new StringBuilder(formattedScopes);
for (int i = 1; i < scopes.Count; i++)
{
scopesSb.Append("%20" + scopes[i]);
}
UriBuilder builder = new UriBuilder("https://account-d.docusign.com")
{
Scheme = "https",Path = "/oauth/auth",Port = 443,Query = BuildQueryString(clientId,scopesSb.ToString(),redirectUri,responseType,state)
};
return builder.Uri;
}
解决方法
感谢您的联系。我是 Gloriana,是 DocuSign 开发者支持团队的一员。
请确保在重定向 URI 部分下为正在使用的集成密钥配置了指定的重定向 URI。请记住,在使用您的身份验证 URL 时必须使用完全相同的重定向 URI。
指定部分位于设置 > 应用程序和密钥 > 单击您的集成密钥 > 编辑
我还建议您创建一个新的集成密钥,因为您已在此线程上公开共享它。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。