Resolving 401 Unauthorized Errors When Embedding with Docker Localhost Deployments
When deploying Report Server in a Docker environment using localhost, embedded reporting scenarios may fail with a 401 Unauthorized error. This occurs because localhost references the local container environment and can cause authentication and proxy URL mismatches during embedded requests.
To ensure proper authentication and embedding functionality, the Report Server should be configured using one of the following instead of localhost:
host.docker.internal- Server IP address
Cause
When the Report Server is initially launched using localhost in a Docker deployment, the server configuration is generated based on that URL. This can lead to authentication and proxy URL mismatches during embedding scenarios, resulting in 401 Unauthorized errors.
Resolution
For New Installations
If you are performing a fresh installation of the Report Server in Docker:
- Complete the installation.
- Launch the Report Server for the first time using one of the following:
host.docker.internal- Server IP address
Important: Do not use
localhostwhen initially launching the Report Server. The initial configuration is generated based on the URL used during the first launch. Usehost.docker.internalor the server IP address instead to avoid embedding and authentication issues.
Examples:
For Existing Installations
If the Report Server has already been configured using localhost, update the Proxy URL settings through the User Management Server (UMS).
Prerequisites
- You must have a UMS Administrator account.
- Site-level administrator permissions are not sufficient.
UMS Administration URL
http://localhost:8090/ums/administration/user-management/users
Site Administration URL
http://localhost:8090/reporting/site/site1/administration/user-management/users
Note: The Site Administration page and UMS Administration page are different. Proxy settings can only be modified through the UMS portal.
How to Access Site Management in UMS
-
Sign in with a UMS Administrator account.
-
Click the User Profile icon in the upper-right corner.
-
Verify that the Manage Sites option is available.
If the Manage Sites option is not displayed, the account does not have UMS Administrator privileges.
-
Click Manage Sites.
You will be redirected to:
http://localhost:8090/ums/sites
Updating the Proxy Settings
- From the UMS portal, navigate to Settings → Proxy Settings.
- Locate the Site URL or Proxy URL field.
- Replace the localhost URL with either:
host.docker.internal- Server IP address
- Save the changes.
- Restart the Report Server services to apply the updated Proxy URL settings.
Note: Restarting the Report Server services is mandatory after updating the Site URL or Proxy URL settings.
Expected Result
After updating the Site URL or Proxy URL to use host.docker.internal or the server IP address and restarting the services, embedded reports should authenticate successfully and the 401 Unauthorized error should no longer occur.
Best Practices
- Avoid using
localhostfor Docker-based Report Server deployments. - Configure the server URL using
host.docker.internalor the server IP address during the initial launch. - Ensure the Site URL and Proxy URL are configured consistently.
- Verify that embedded applications use the same Report Server URL configured in the Site URL or Proxy URL settings, whether it is a server IP address,
host.docker.internal, or a reverse proxy URL.
By following these recommendations, you can avoid authentication-related issues and ensure that embedded reporting functions correctly in Docker deployments.