Okay, after some researching on github, Cannot connect to UAT using sf_auth · Issue #33 · StevenMMortimer/salesforcer · GitHub, I was able to authenticate using some httr code which instead of R waiting for the response on localhost:1410 will allow you to input the code into the terminal directly.
On the browser screen where it says localhost refused to connect the URL will look something like this
I had to copy this code and input it into the R Console but I had to replace the "%3D%3D" at the end with a double equals sign
I don't know if that
%3D%3D will be there every time and at the end of the code, in my case it was. Potentially other strange URL character encodings might result?
This allowed me to authenticate and could use salesforcer like I normally would be able to on my local machine.
consumer_key <- "3MVG9CEn_O3jvv0yRMQezJ8PwesiIknRU9v9j778rv78UvJ2JTQzSG.QduxyMxYaldoNEhO0eVvw4ogCT58c5"
consumer_secret <- "3471656211653393546"
callback_url <- "http://localhost:1410/"
sf_oauth_app <- oauth_app("salesforce",
key = consumer_key,
secret = consumer_secret,
redirect_uri = callback_url)
sf_oauth_endpoints <- oauth_endpoint(request = NULL,
base_url = "https://login.salesforce.com/services/oauth2",
authorize = "authorize", access = "token", revoke = "revoke")
sf_token <- oauth2.0_token(endpoint = sf_oauth_endpoints,
app = sf_oauth_app,
cache = ".httr-oauth-salesforcer",