Getting CORS error on my R-Shiny app configured with shinyproxy and auth0

Hi there.
I am hosting an R-Shiny app with shinyproxy and using auth0 for authentication. But I am getting this CORS error:

Access to manifest at 'https://login.mysocialpulse.com/authorize?response_type=code&client_id=OYhoKqOAoChIk4WiFrTRmlY6oG7A3M3f&scope=openid%20email&state=PXVlaYgaShbDf-iOMgYxYUkr8cScffXuL-ne7tXv9Oc%3D&redirect_uri=https://mysocialpulse.com/login/oauth2/code/shinyproxy&nonce=pAohZkehH4tm8Jvismze9tQQNvU_VdrIirvC3tSxhYw' (redirected from 'https://mysocialpulse.com/app_direct/main/img/icon/manifest.json') from origin 'https://mysocialpulse.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

In my auth0 application settings I have,
Allowed callback URLs: https://*.mysocialpulse.com/login/oauth2/code/shinyproxy
Allowed logout URLs: https://mysocialpulse.com
Allowed Web Origins: https://*.mysocialpulse.com
Allowed Origins (CORS): https://*.mysocialpulse.com

I also have custom domain enabled and using Universal login.

Here is my Nginx configuration:

server {
     listen 80;
     listen [::]:80;
     server_name *.mysocialpulse.com;
     return 301 https://$host$request_uri;
}

server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  server_name mysocialpulse.com www.mysocialpulse.com;
  
  ssl_certificate /etc/letsencrypt/live/mysocialpulse.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/mysocialpulse.com/privkey.pem;
  ssl_trusted_certificate /etc/letsencrypt/live/mysocialpulse.com/chain.pem;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
  ssl_ciphers 'TLS13+AESGCM+AES128:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
  ssl_prefer_server_ciphers on;
  ssl_session_cache shared:SSL:50m;
  ssl_session_timeout 1d;
  ssl_session_tickets off;
  ssl_ecdh_curve X25519:sect571r1:secp521r1:secp384r1;

  location / {
    proxy_pass                            http://127.0.0.1:8081/;
    proxy_http_version                    1.1;
    proxy_set_header Upgrade              $http_upgrade;
    proxy_set_header Connection           "upgrade";
    proxy_read_timeout                    600s;
    proxy_redirect                        off;
    proxy_set_header Host                 $http_host;
    proxy_set_header X-Real-IP            $remote_addr;
    proxy_set_header X-Forwarded-For      $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto    $scheme;
  }

}

Here is my shinyproxy configuration:

server:
  forward-headers-strategy: native
  secureCookies: true
proxy:
  logo-url: https://files.mysocialpulse.com/logo.png
  landing-page: /app_direct/main
  port: 8081
  heartbeat-rate: 10000
  heartbeat-timeout: 60000
  container-wait-time: 40000
  authentication: openid
  openid:
    auth-url: https://login.mysocialpulse.com/authorize
    token-url: https://login.mysocialpulse.com/oauth/token
    jwks-url: https://login.mysocialpulse.com/.well-known/jwks.json
    client-id: #####
    client-secret: #####
    logout-url: https://login.mysocialpulse.com/v2/logout?returnTo=https%3A%2F%2Fmysocialpulse.com&client_id=#####
  docker:
    cert-path: /home/none
    url: http://127.0.0.1:2375
    port-range-start: 20000
  specs:
  - id: main
    display-name: MySocialPulse
    description: production version of mysocialpulse
    container-cmd: ["R", "-e", "shiny::runApp('/apps/mysocialpulse/main')"]
    container-image: mysocialpulse-main

  - id: test
    display-name: MySocialPulse Test
    description: Test version of mysocialpulse
    container-cmd: ["R", "-e", "shiny::runApp('/apps/mysocialpulse/test')"]
    container-image: mysocialpulse-test

logging:
  file:
    shinyproxy.log

Any idea what is causing the problem and how to resolve it?

Hi

I don’t know what is causing the CORS error. Are you able to login and then get this error? Or is it even before logging in? Could you maybe try in a private window?

The callback URL should be set to the domain where ShinyProxy is running. I’m not sure whether this url (using the wildcard) will work.