Google Auth in Shiny Proxy

Hi,

I have an application with Google Authentication using GoogleAuthR Package.
When I run the app the google authentication throws “Refused to connect error”
I am getting following error on Network Element

“Refused to display ‘https://accounts.google.com/’ in a frame because it set ‘X-Frame-Options’ to ‘deny’.”

Please help me to resolve this.

If your host system has verified connection to internet you could try docker run the created docker image with --network host tag if that works.

Otherwise, if you are behind (company) proxy, you should specify proxy as ENV variables in the dockerfile like so:

FROM openanalytics/r-base

LABEL build_date="2022-01-11"
LABEL version=3.3

ENV https_proxy="http://ip:port"
ENV http_proxy="http://ip:port"

RUN ...and so on

Hi Pat,

Thanks for the reply,
I tried the above suggestion. But it didnt work for me. I think I didnot properly explained my problem.
Here is my issue,

We are using AWS EC2 instance which is in public subnet and it has a public IP so it has direct connection to internet.
And we are using shinyproxy for our application and we did our configurations in application.yml so we use to run jar file java -jar shinyproxy-2.6.0.jar instead of docker run to run the application.
I have in my App(01_hello), a button that sends a request for Oauth authentication to google, we use GoogleAuthR package in Rshiny

We have added the below Redirect URI’s in the google console to authorize.
http://:/app/01_hello
http://:/app_direct_i/01_hello

We see authentication happens in google with 200OK, But we have ended up with the error - accounts.google.com refused to connect.

Can you please help on this.

My application.yml is:
proxy:
title: Open Analytics Shiny Proxy
logo-url: favicon.ico
landing-page: /
heartbeat-rate: 10000
heartbeat-timeout: 60000
port: 8080
authentication: none

docker:
cert-path: /home/none
url: http://localhost:2375
port-range-start: 20000
specs:

  • id: 01_hello
    display-name: Hello Application
    description: Application which demonstrates the basics of a Shiny app
    container-cmd: [“R”, “-e”, “shinyproxy::run_01_hello()”]
    container-image: openanalytics/shinyproxy-demo

logging:
file:
name: shinyproxy.log

Hi Madhu!

I think the problem could be with the headers that the server is sending to google, I had a similar problem using amazon cognito. I added this to my application.yml and it worked:

server:
forward-headers-strategy: native

This would be in the same level as the Proxy.
For more info you can check this page here:
https://shinyproxy.io/documentation/security/#forward-headers
https://shinyproxy.io/faq/#invalid-redirect_uri-when-using-openid-connect-or-keycloak

Hi Nrarnt,

I have the changed the “server:
forward-headers-strategy: native”

Still I am getting refused to connect error.

Please suggest any other options.

Hi @Madhu_Bala

I’m afraid the error message “Refused to display ‘https://accounts.google.com/’ in a frame because it set ‘X-Frame-Options’ to ‘deny’.” is because of a protection of Google. They try to prevent phishing and other attacks with this protection.

There are a few ways to handle with this:

Hope this helps.

Hi,
I have tried the code which is given in the [https://mark.shinyapps.io/googleAuthRMarkdown/ ] link.

But I have got the following authorization error. Can you please help me out.