reading PDF from local storage gives 401 error

Explorer ,
Jul 20, 2020 Jul 20, 2020

Copy link to clipboard

Copied

Hello:

I have PDF stored as blobs in local storage (indexed.db). When I read I get a 401 error in console.

 

 

 

var adobeDCView = new AdobeDC.View({ clientId: "xxxx", divId: 'pdf-content' });
adobeDCView.previewFile({
   content: { promise: store.get('test.pdf' },
      metaData: { fileName: "test.pdf" }
   },
   {
     embedMode: "SIZED_CONTAINER"
   });

 

 

 

I get a : ViewSDKInterface.js:1 POST https://viewlicense.adobe.io/viewsdklicense/jwt 401 (Unauthorized) error. I

 

 

 

Views

319

Likes

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

correct answers 1 Correct Answer

Adobe Employee , Jul 22, 2020 Jul 22, 2020
You have to generate a client ID if you wish to use a web server. You can set the domain as localhost.Please try creating credentials from https://www.adobe.io/apis/documentcloud/dcsdk/gettingstarted.htmlHope this helps.

Likes

Translate

Translate
Adobe Employee ,
Jul 22, 2020 Jul 22, 2020

Copy link to clipboard

Copied

Thank you for using PDF Embed API. The error seems to indicate that your webpage domain is not authorized to use the client ID configured in the code. Would be great if you could check and confirm if the client ID is used with the correct domain. 

Likes

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
Explorer ,
Jul 22, 2020 Jul 22, 2020

Copy link to clipboard

Copied

Unfortunately I have not been able to set the credentials to localhost to test out the new API. And I cannot risk putting it in our production domain. So what would be a suitable solution? Thanks

Likes

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 ,
Jul 22, 2020 Jul 22, 2020

Copy link to clipboard

Copied

You have to generate a client ID if you wish to use a web server. You can set the domain as localhost.

Please try creating credentials from https://www.adobe.io/apis/documentcloud/dcsdk/gettingstarted.html

Hope this helps.

 

Likes

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
Explorer ,
Jul 22, 2020 Jul 22, 2020

Copy link to clipboard

Copied

Yes Sumona Ghosh it worked. Earlier I was trying to change an existing console project and it somehow prevented me from setting it. Thanks.

Likes

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 ,
Dec 06, 2020 Dec 06, 2020

Copy link to clipboard

Copied

not able to set domain localhost getting error.

what should i do? I want to run it on localhost:4200

 

Likes

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 ,
Dec 07, 2020 Dec 07, 2020

Copy link to clipboard

Copied

LATEST

Please try creating new credentials from here: https://www.adobe.io/apis/documentcloud/dcsdk/gettingstarted.html

 

You need to set the Application Domain as localhost. Hope this works.

Likes

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