WebViewer Version: latest
ISSUE: When a password protected file is opened in webviewer, password was not prompted to the user.
In the earlier version - 1.5.3, this issue was resolved with a workaround to not open the file using webviewer cache. WebViewer(
{ webviewerServerURL: null,
},
This resolved the issue, and password was prompted to the user as shown below
Password is not prompted when the document is loaded.
I am calling the documentload as shown below
documentViewer.loadDocument(fileUrl, {
filename: fileName,
cacheKey: ket,
customHeaders:
});
And also getting this error in console-“Uncaught (in promise) Document requires a password. If you wish to process this type of document please use the password option.”
I am doing the same
instance.UI.loadDocument(fileUrl, {
filename: fileName,
cacheKey: ket,
customHeaders:
});
But still no prompt is coming for password.
Anything to add in WebViewer instance. This is the how I am initializing the WebViewer .
WebViewer(
{
path: “/WebViewer/lib”,
webviewerServerURL: ,
licenseKey,
fullAPI: true,
disableLogs: true,
css: ,
},
Hi,
I just gave a sample without original values. May be consider the below sample
WebViewer(
{
path: “/Scripts/WebViewer/lib”,
webviewerServerURL: http://localhost:8090/demo/,
licenseKey,
fullAPI: true,
disabledElements: [
“downloadButton”,
“printButton”,
“thumbnailControl”,
“documentControl”,
],
disableLogs: true,
css: “/scripts/Webviewer.css”,
},
Should I configure anything more for the password prompt?
Hi,
I found the issue.
I had to use instance.UI.loadDocument instead of documentViewer.loadDocument.
Now I can see the password modal when password protected file is opened as shown below:
But there is one more issue which I would like to address. I tried to load the password protected files with webviewerServerURL while initializing webviewer.
WebViewer(
{
webviewerServerURL: ‘http://localhost:8090’),
},
)
For the first time, the password modal appears to enter the password, but on the second attempt, the file loads in the background before the password popup is displayed, as shown below:
The details page appearing in the background is an issue, as the content should be protected and not displayed without the correct password.
Looks like this issue is because of caching the document in webviewer server.
Is there a way to prevent the content from being displayed before entering the correct password?