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
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
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.
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:
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:
use ShinyProxy without the iframe. You can access any app over the /app_direct/<app_id>/ endpoint and then the app is not loaded in an iframe. However, you loose some of the nice features of ShinyProxy (navbar, loading screen, etc)
use the OAuth2/google auth integration in ShinyProxy and don’t implement it in the app