Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

docusignapi - DocuSign returning HTML from Authentication only when the application is under a domain

i'm integrating the docusign api with my angular application, everything is working good, i created a proxy configuration in order to do the api calls, im using the demo url since i have a demo developer account. The problem is that when i run my program in local (using localhost) the authentication token is successfully returned by the oauth call but when i upload my program on an external domain the same call returns me an html with irrelevant information with status 200 OK. I tried to search this on google but i can't find nothing good. What should i do?

this is the error i get: ERROR qm error: {error: SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse () at XMLHtt…, text: "<!doctype html>??? <meta ch…b0a19788ec.js" defer="">??"}headers: DmlazyInit: ()=> {…}lazyUpdate: nullnormalizedNames: Map(0)?{}proto: Objectmessage: "Http failure during parsing for http://frontendly.it/oauth/token"name: "HttpErrorResponse"ok: falsestatus: 200statusText: "OK"url: "http://frontendly.it/oauth/token"proto: Bm

question from:https://stackoverflow.com/questions/65940601/docusign-returning-html-from-authentication-only-when-the-application-is-under-a

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The OAuth call you are making has a parameter called redirectUri. Look for &redirect_uri= in the URL. You have to change that for each location, if you put this in a domain - then you cannot use localhost in there.

This URL has to match exactly to where you deployed your application.

For the second call, make sure to make it a POST, not GET, add the headers like this: (more information)

curl --header "Authorization: Basic NWMyYjhkN.....FhODg2MQ=="
--data "grant_type=authorization_code&code=eyJ0eXAi.....QFsje43QVZ_gw"
--request POST https://account-d.docusign.com/oauth/token

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...