• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Help with OAuth2

New Here ,
Apr 08, 2015 Apr 08, 2015

Copy link to clipboard

Copied

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

TOPICS
SDK , SharePoint and Salesforce integration

Views

18.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 09, 2015 Apr 09, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 10, 2015 Apr 10, 2015

Copy link to clipboard

Copied

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 ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 10, 2015 Apr 10, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 09, 2017 Dec 09, 2017

Copy link to clipboard

Copied

Also having the same problem - very frustrating

details.

Url used in my application is (actually generated from adobe nodejs api)

https://secure.echosign.com/public/oauth?

    redirect_uri=https://lcoalhost:3000/redirect/&

    response_type=code&

    client_id={MY CLIENT ID}&

    scope=user_login:self+agreement_send:account

Please help - I'm using the nodejs sdk from an angular 5 application.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 10, 2015 May 10, 2015

Copy link to clipboard

Copied

Hello,

Sorry, How you take "code" in sample 1?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 23, 2016 Nov 23, 2016

Copy link to clipboard

Copied

Can u please take look on my recent comments/issue (very similar to original question) but issue is different as i am getting totally un expected/un-documented response !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

Hi Rave,

Does adobe provides free developer access to test EcoSighn if yes please help me with below , else suggest a way to implement EcoSighn for C# developer. Do I require enterprise license to test also or be a part of enterprise account privileges.

I created a developer account as per Get a Developer Account

When I went to create application as per Create an Application​ on click of API it was giving me below message.adobe_sighn_click_upgrade_message.PNG

I went ahead on creating application by clicking on API Application link in left pane of the image shown.

I created Customer domain account and configured OAuth as Configure OAuth for the Application .

I tried accessing token as Get the Access Token​ I chnaged returned url to "https://www.google.com" and also provided my client id . After hitting enter in a browser I get below error. Please suggest what to be done.unauthorized_error.PNG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

Hello Faiyazul,

Can you inbox me your registered email address along with name of Application created and Authorisation URL so that I can quickly check?

Thanks,

-Rijul

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 15, 2017 Jun 15, 2017

Copy link to clipboard

Copied

I have inboxed you my details.

Url I used in my browser is

https://secure.echosign.com/public/oauth?

    redirect_uri=https://www.google.com&

    response_type=code&

    client_id={MY CLIENT ID}&

    scope=user_login:self+agreement_send:account

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2017 Jun 19, 2017

Copy link to clipboard

Copied

HI Rijul,

Any update?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 25, 2017 Jul 25, 2017

Copy link to clipboard

Copied

Hi faiyazulnoor, I'm having the same exact problem. No matter how many times I've check that my request is correct, I keep getting the same invalid_request error. Did you ever get it to work? What was your error? please let me know so I can also get mine to work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 07, 2017 Aug 07, 2017

Copy link to clipboard

Copied

Same issue here with absolutely no forum support on the topic.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 12, 2015 May 12, 2015

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 11, 2015 Jun 11, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 11, 2015 Jun 11, 2015

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 11, 2015 Jun 11, 2015

Copy link to clipboard

Copied

Yes, that is all I changed.  Below is my full request.

string result = string.Empty;

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

    Request.QueryString["code"], Request.QueryString["state"], txtApplicationSecret.Text);

HttpWebRequest soapRequest = (HttpWebRequest)WebRequest.Create("https://secure.echosign.com/oauth/token");

soapRequest.Method = "POST";

soapRequest.ContentType = "application/x-www-form-urlencoded";

using (Stream requestStream = soapRequest.GetRequestStream())

{

    using (StreamWriter wtr = new StreamWriter(requestStream))

    {

        wtr.Write(request);

    }

}

HttpWebResponse soapResponse = (HttpWebResponse)soapRequest.GetResponse();

using (Stream responseStream = soapResponse.GetResponseStream())

{

    using (StreamReader rdr = new StreamReader(responseStream))

    {

        result = rdr.ReadToEnd();

    }

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 12, 2015 Jun 12, 2015

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 28, 2016 Jan 28, 2016

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 29, 2016 Jan 29, 2016

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 27, 2016 Apr 27, 2016

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 27, 2016 Apr 27, 2016

Copy link to clipboard

Copied

Hello Lucas,

Can you check if the scopes defined in application is exactly the same as defined in the authorisation request url? Also, in between, please inbox me your registered email address as well.

Regards,

-Rijul

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 23, 2016 Nov 23, 2016

Copy link to clipboard

Copied

I am also stuck in similar but not same situation  . WE have web app which used old adobe sign SOAP api to send documents for signature.

Since the availability of restful cloud apis, we are migrating to all rest (HTTP) communication rather than SOAP. But for to use rest apis, we need to get authorization and access code from Adobe oauth server/service.

As per the documentation we creaated new application and configured for few scopes and try to get authorization code before getting actual accesses token . But for some reason we are always getting full html page back from this auth access url. My get request looks like this

"

https://secure.na1.echosign.com/public/oauth?redirect_uri=https://secure.na1.echosign.com/public/oau...

response_type=code&client_id=CBJCHBCAABAAI8pKueObDHLRDDHSLdThEDvCkGvUtVlG&scope=agreement_send "

And  i have one main question , why do we need to give redirect uri ?? it should have been optional for head less api to make calls.

Mainly our application is an internal application and whats the value of redirect uri ? (repeating same question) .

But for now i dont even getting response as described the Adobe Sign, an Adobe Document Cloud Solution documentation .

What i am doing wrong here ??

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 30, 2017 May 30, 2017

Copy link to clipboard

Copied

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_ty..."

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 26, 2018 Jan 26, 2018

Copy link to clipboard

Copied

Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines