Issue
When using Connect Gallery content (like the Usage Metrics Dashboard) in a load balanced environment, you may encounter issues where the application requests an API key even after one has been provided. This typically manifests as an error message stating "Iss claim must match the server address."
Description
This issue occurs when Connect is behind a load balancer or reverse proxy, causing a mismatch between the server address specified in the Connect configuration and the address being used to access the server through the load balancer.
Solution
To resolve this issue, add the following configuration to your Connect configuration file (/etc/rstudio-connect/rstudio-connect.gcfg):
[Server] AlwaysUseServerAddress=true
After adding this configuration:
- Save the configuration file
- Restart the Connect service using:
sudo systemctl restart rstudio-connect
This setting forces Connect to correctly compare the 'iss' claim against the full server address specified in the Connect config, resolving the API key validation issues in load balanced environments.
If you're still having issues, you can reach out to Support by opening a ticket here.