IDE on AWS instance trouble with API packages

i'm trying to connect the google drive and googlesheets4 api to a Rstudio IDE on an EC2 instance, but whenever i call the respective auth functions, i get a 'localhost refused connect.' message. Any idea what is going on/potential solutions?

Its difficult to give feedback without an idea of the configuration of your RStudio environment and your AWS system. Can you give a reprex of the code you're running and the stacktrace from the error?

My first thought is the EC2 is running on a network that might not allow this type of traffic. Your inbound VPC rules would be helpful to rule this out.

I have two inbound rules
Type:HTTP; Protocol:TCP; Port:80; Source: anywhere
Type:SHH; Protocol:TCP; Port:80; Source: anywhere

for the code, it is the basic "drive_auth" function and nothing more and the error message occurs outside of the environment in the google account authentication page

I would expect the authentication is using an HTTPS connection. Can you add an inbound rule for port 443 to allow those connections?

i've added the rule, but i am still getting the same error. Do i need to specify a source?

Apologies for the confusion. According to this GitHub issue, using this API in a server requires a bit of a workaround.

This looks to be working for most people:

drive_auth(new_user = TRUE)

that worked perfectly. Thanks for your help!

You should then mark @EliMiller's answer as the solution to your issue... for posterity.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.