3

I have a Shiny application in a Docker container hosted on Microsoft Azure WebApp. The application doesn't work anymore when log in with Azure Active Directory is activated.

The application page is accessible but a error 500 is returned on websocket content as shown on the Firefox network trace. This error is not present without log in with AAD.

I've tried adding the following options to /etc/shiny-server/shiny-server.conf:

sanitize_errors off;
disable_protocols websocket xdr-polling;

This did not solve the issue, the network trace are unchanged. How can I force Shiny not to use websocket?

RYegavian
  • 101
  • 6
  • Related to the question here: https://stackoverflow.com/questions/56797036/how-do-i-get-shiny-server-to-working-with-azure-active-directory I'm having the same problem when activating AD authentication on Azure App services, only plain HTML is loaded and seeing HTTP 400 for most static JS ressources. W/o AD authentication activated it works fine. – lhaferkamp Oct 22 '19 at 18:13

3 Answers3

1

EDIT:

With the new version of Azure App Services this problem was solved. My solution below is NOT needed any more!

Upgrading to the latest Shiny and its underlying httpuv library (>= 1.5.2) is also recommended which solves some related problems (see https://community.rstudio.com/t/shiny-v1-3-known-regressions-and-serious-issues/28180).

Before I had to solve the problem described here How do I get Shiny-server to working with Azure Active Directory

Original answer (now deprecated for resolving the issue with Azure App Services):

I had the same problem with Shiny: The browser can't load Websocket content when Azure Active Directory (AD) Authentication is enabled. The websocket call got HTTP 101 ("Switching protocols"). But its working when AD Authentication is disabled, so seems like the problem source is the Azure Proxy doing the authentication (e.g. it inserts some HTTP headers). I solved the problem via disable_protocols websocket xdr-polling; in the Shiny server config.

lhaferkamp
  • 676
  • 8
  • 10
  • Not really stable this solution though, I discussed with Azure support, they promised to release Websocket support for Linux containers in 12/2019 – lhaferkamp Nov 20 '19 at 12:46
0

You can´t. R Shiny is actually built on top of websockets and runs an R Process. Without websockets, reactivity in Shiny would not be possible.

Read here: https://community.rstudio.com/t/is-there-any-equivalent-of-web-sockets-in-shiny-world/17908

Data Mastery
  • 1,555
  • 4
  • 18
  • 60
0

As specified in Shiny Server Administrator's Guide, you could use the disable_websockets parameter in /etc/shiny-server/shiny-server.conf file, see Configuration Settings section :

run_as shiny;

server {
  listen 3838;
  disable_websockets;
  #...
}
Waldi
  • 39,242
  • 6
  • 30
  • 78