Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate_token() not working on rstudio server #4

Closed
tsahota opened this issue Jun 19, 2022 · 2 comments
Closed

generate_token() not working on rstudio server #4

tsahota opened this issue Jun 19, 2022 · 2 comments
Labels
wontfix This will not be worked on

Comments

@tsahota
Copy link

tsahota commented Jun 19, 2022

In rstudio desktop (windows), the followings works:

generate_token(client_id = "XXXXXXX",
                          client_secret = "YYYYYYYYYYYYYYYYYYYYYYYYYYYY",
                          cache = TRUE)

I get Authentication complete. Please close this page and return to R. in the browser with url of the format http://localhost:1410/?code=XXXXXXXXXXXXXXX&state=YYYYYYYYY#_=_

However in RStudio server (running through docker) gives a "This site can’t be reached. localhost refused to connect." message in the browser.

The RStudio server can use the .httr-oauth generated just fine.

Any ideas? Let me know if you need more info.

Thanks!

@mrkaye97
Copy link
Owner

mrkaye97 commented Jun 23, 2022

Hey @tsahota, thanks for putting in the issue!

My suspicion is that the wiring for callback URLs doesn't work the same in Docker / RSS as it does on your local where you can open a page in a browser.

I tried to repro in Docker on local. Here's what I did (from the command line):

docker run -it --entrypoint bash rocker/r-ver:4.1.2

Then, in the bash session I ran:

apt-get update && \
apt-get upgrade -y && \
apt-get install -y --reinstall xdg-utils && \
apt-get install -y lynx

R

then after installing packages and starting R, I did:

install.packages("remotes")

remotes::install_github("mrkaye97/fitbitr")

fitbitr::generate_token(client_id = "XXX", client_secret = "YYY")

and I saw:

Waiting for authentication in browser...
Press Esc/Ctrl + C to abort

which just hung for me, since I don't have a browser to authenticate in when running in Docker.

TL;DR: I don't think as it's written right now, fitbitr will work in Docker. That said, if you're interested in contributing an auth flow that will work non-interactively, that would be awesome!

@stale
Copy link

stale bot commented Aug 31, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 31, 2022
@stale stale bot closed this as completed Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants