PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, August 26, 2022

[FIXED] How to get Authorization_code and access_Token and send envelope DocuSign using asp.net

 August 26, 2022     access-token, asp.net, docusignapi, webforms     No comments   

Issue

I am trying to send envelope using docuSign, but having error while get authorization_code which need to get access_Token.

Please help me to get authorization_Code and access_Token.

I am using ASP.Net web forms and .NET framework 4.5.2

  • DocuSign.eSign.dll 5.2.0
  • DocuSign.Integration.Client.dll 1.7.2

Request: 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

Response: 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;
}

Solution

Please make sure that the specified redirect URI is configured under the redirect URI section for the integration key that is being used. Please keep in mind that the same exact redirect URI has to be used when using your authentication URL.

The specified section is found under Settings > Apps and Keys > Click on your integration key > Edit

I would also recommend creating a new integration key, since you have shared it publicly on this thread.



Answered By - Gloriana Marin
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing