Skip to main content
Participant
April 8, 2015
Question

Help with OAuth2

  • April 8, 2015
  • 17 replies
  • 21291 views

We have an internal WPF application which needs to use the EchoSign functionality. Basically, the application will send some letters which needs to be e signed by an external user.


I’ve created the EchoSign developer account and added an application under the “All Applications” section.

I'm stuck with the OAuth step. When I replace just the client_id in the OAuth demo  ( https://secure.echosign.com/public/oauthDemo ) with my application’s client_id, I get the following error message

Unable to authorize access because the client configuration is invalid: invalid_request

Am I missing anything ? Also, I notice that the below OAuth query requires a  redirect_uri parameter. What would be the value in my case as it’s an internal WPF application ?

https://secure.echosign.com/public/oauth?
redirect_uri=https://secure.echosign.com/public/oauthDemo&
response_type=code&client_id=9MEJXY4Y4R7L2T&scope=agreement_send

Thanks

This topic has been closed for replies.

17 replies

Participant
September 1, 2017

same for us

Participant
September 15, 2017

Adobe support response endpoint error so !

Original URL (from documentation) : https://secure.echosign.com/public/oauth?

New Url : https://secure.eu1.echosign.com/public/oauth?

How to get your endpoint ?

On your dashboard :

Participant
October 14, 2017

Have there been any updates to this? I've been banging my head against the wall for hours trying to figure out why this thing isn't working at all. I keep getting invalid_request, and it looks like the documentation is likely incorrect as there's a large influx of people reporting this same problem.

Participant
August 21, 2017

I am stuck there, deadend at the start of project. Did anyone got this working. I am getting "Unable to authorize access because the client configuration is invalid: invalid_request" error.

josep95059497
Participant
May 31, 2017

I had the same problem and maybe you already got it working, but in case somebody else has the same problem

In your account setup if you have a personalized hostname then use it

for example something like this

"https://[personalizedhostname].na2.echosign.com/public/oauth?redirect_uri=[callbakc_uri]&response_type=code&client_id=[Client_ID]&scope=user_login:self+agreement_send:self"

Even, if this happened you can see in the right menu "Adobe Sign API" > API Information > Documentation > REST API Methods Documentation. That the documentation link will be "https://[personalizedhostname].na2.echosign.com/public/docs/restapi/v5"

and all the examples will be the same.

That was my problem, hope this helps someone else.

Best Regards

Jose Perez

Participant
January 26, 2018

Thank you!

Participant
January 29, 2016

I am wondering if anyone have tried to do this with JavaScript (specifically AngularJS) before? I am having an issue at the exact same step (but not the same error). I've been stuck on this for a long time, so any input/advice/suggestion would help!

Here are the steps I took:

1) Same authorization step as OP and retrieved an authorization code from the query string parameters.

2) Extracted the code and used it to do a POST request. POST request status returns a 200 OK, but it also returns an error saying that my origin is not allowed access:     

"XMLHttpRequest cannot load https://secure.na1.echosign.com/oauth/token. No 'Access-Control-Allow-Origin' header is present on the requested resource."

My code for POST request is:

$http({
method: 'POST',
url: 'https://secure.na1.echosign.com/oauth/token',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data : 'code=' + code
+ '&client_id=' + appId
+ '&client_secret=' + clientSecret
+ '&redirect_uri=' + redirectURI
+ '&grant_type=authorization_code'

I've double and triple checked that the appId and clientSecret are correct. The redirectURI is for sure the same as the one used in step 1 for the authorization step.

Inspiring
January 29, 2016

Hello Iris,

Just to confirm if you are providing the exact scopes in the Authorisation request as defined in the application. Also, please inbox me the registered email address you have so that I can check the API calls.

Regards,

-Rijul

April 27, 2016

I'm trying to integrate this on localhost first. I created API application, setted all permissions and with URL https://secure.na1.echosign.com/public/oauthDemo . I obtained the "code" value on this page https://secure.na1.echosign.com/public/oauthDemo . Now I'm trying in Java app to obtain "access_token" with URL from previous response Web access: https://secure.na1.echosign.com/oauth/token . I'm using correct client id and secret data with same redirect URL and code I get before manually but in the response I get:

{"error_description":"invalid authorization code","error":"invalid_request"}

What I'm doing wrong? It's my flow ok or it's necessary to have redirect URL from my app? If yes how I can do this on localhost first?

Participant
June 12, 2015

Jack,

Regardless if you are using an internal application or not you still need to create an external endpoint to receive the codes necessary to create your access token.

andocom
Participant
May 13, 2015

I am having the same issue, a token is produced if I post the values from a plain HTML form, but using a C# Webclient / WebRequest it always fails with 401 Unauthorized error, it is very frustrating.

Participant
June 11, 2015

Did you ever get this figured out?  Im having the same issues with C# and level of frustration.

Post Edit

For those of you C# programmers that may be having same issues.  My issue was because I had line breaks in the request data.

Broke Code:

string requestData = string.Format(@"code={0}&

client_id={1}&

client_secret={2}&

redirect_uri=https://mywebsite.com&

grant_type=authorization_code",

code, id, secret);

Good Code:

string requestData = string.Format("code={0}&client_id={1}&client_secret={2}&redirect_uri=https://mywebsite.com&grant_type=authorization_code",code, id, secret);

Hopefully this helps someone

andocom
Participant
June 11, 2015

Wilks, I haven't resolved this as yet and support I have to say was pretty terrible. I'm back on the project now though so hopefully this helps. Were you also getting the 401 : UnAuthorized error?

Looking at your code is that all you changed? Would it be possible to post your full request code sample?

Rave
Participating Frequently
April 10, 2015

Hi Chriag,

Have you checked the doc:https://secure.echosign.com/public/static/oauthDoc.jsp#overview

The redirected url you are using is it a public facing url?

Regards,

Rave

Participant
April 10, 2015

Hello Rave,

Yes ! I did check the document. Unfortunately, I could make OAuth work at my end.

Below are the steps which I tried

1) For the authorization step, I tried a https public facing url in the below url and got the "code" from the query string parameters

https://secure.echosign.com/public/oauth?redirect_uri=https://somepublicfacingurl.com&

response_type=code&client_id=d4HQNPFIXFD255H&scope=user_login:self+agreement_send:account

2)   Used the "code" received from the first step in my C# windows application and tried making the second POST request with the required parameters. Below is my code

            string URI = "https://secure.echosign.com/oauth/token";

            string reDirectUri = "https://somepublicfacingurl.com";

            string grantType = "authorization_code";

            string myParameters = String.Format("grant_type={0}&client_id={1}&client_secret={2}&redirect_uri={3}&code={4}", grantType, clientId, clientSecret, reDirectUri, code);

            using (WebClient wc = new WebClient())

            {

                WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultCredentials;

                wc.UseDefaultCredentials = true;

                wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";

                string HtmlResult = wc.UploadString(URI, myParameters);

            }

  

Unfortunatelty, it gives an 401 : UnAuthorized error.  Am I missing anything ? The OAuth is configured for the application.

Would it be possible for you to share a sample C# OAuth2 code ?

Inspiring
April 10, 2015

Hello Chirag,

I can see that there is a ticket logged with this issue and our team is currently working on the code sample you have provided and will get back to you.

Regards,

-Rijul