Generating a 501 error when trying to hit the Document Viewer API endpoint


While trying to create a version of the DNN document viewer using the API, you received a 501 error even after attaching to the header of the get request, the request verification token, module id, and tab id. When trying to resolve this issue by using JWT authentication instead by requesting an authentication token, an infinite loop is returned to the user making the request.



Instead of using the Document Viewer API endpoint, it is recommended to utilize JWT Authentication.

To use JWT:

After performing the above steps, unfortunately, an ERR_TOO_MANY_REDIRECTS message is shown. Follow the steps below to workaround the error.


The root cause is that on authentication, the error is coming up and forces the application to check whether logout is required or not. While doing the check, the application tries to verify the token and falling down to the same exception again. It produces an infinite loop and too many redirects error message is showing up to the end-user.


DNN Platform

This issue has been fixed in DNN Platform 9.6.2, if you are currently using Platform, you will need to upgrade to 9.6.2 or higher.



If you are currently using Evoq, you will need to wait for a future release of Evoq for a full fix (As of writing, Evoq 9.6.4 is currently on Platform 9.6.1).

In the meantime, you can apply a workaround:

  1. Download the attached DotNetNuke.HttpModules.dll.
  2. Go to the Bin folder in the Root directory of your website and take a backup of the existing DotNetNuke.HttpModules.dll file.
  3. Replace the DotNetNuke.HttpModules.dll file with the attached DotNetNuke.HttpModules.dll.

If the next release of Evoq does not contain Platform 9.6.2 or higher, you will need to perform these steps once again after an upgrade as the upgrade will overwrite the files that were replaced.




Please sign in to leave a comment.