Skip to content

Conversation

@m-mohr
Copy link
Member

@m-mohr m-mohr commented Sep 1, 2022

Not tested yet. We need to test a locally hosted Jupyter and a remote one.

Related: #119

We need to check whether we run into this issue again: r-lib/httr2#103

Maybe we can remove the code completely?

@m-mohr m-mohr requested a review from flahn September 1, 2022 12:41
@m-mohr m-mohr self-assigned this Sep 1, 2022
@m-mohr m-mohr marked this pull request as draft September 1, 2022 12:47
@flahn
Copy link
Member

flahn commented Sep 2, 2022

A similar issue might occurs, when you try to login in pure R.

Copy <anonymized> and paste when requested by the browser
Press <enter> to proceed:
/usr/bin/xdg-open: 882: www-browser: not found
/usr/bin/xdg-open: 882: links2: not found
/usr/bin/xdg-open: 882: elinks: not found
/usr/bin/xdg-open: 882: links: not found
/usr/bin/xdg-open: 882: lynx: not found
/usr/bin/xdg-open: 882: w3m: not found
xdg-open: no method available for opening 'https://aai.egi.eu/auth/realms/egi/device?user_code=<anonymized>'
✔ Waiting for response from server [1m 12.7s]

There are error messages and at the end, where you can copy/paste the link. I'm not sure if we can somehow query the R system if a browser is installed.

@flahn
Copy link
Member

flahn commented Sep 2, 2022

options("jupyter.in_kernel"=TRUE)
connect("openeo.cloud")
login()

This fails: Login failed. Reason: OAuth 2.0 device flow requires an interactive session

@flahn
Copy link
Member

flahn commented Sep 2, 2022

I guess the interactive requirement for the check is preventing the rest of the code from running:

https://github.com/r-lib/httr2/blob/487c23e203e38539198432c025fc16b48bf2d498/R/oauth-flow-device.R#L61

@m-mohr
Copy link
Member Author

m-mohr commented Sep 2, 2022

Yes, this is probably why we set interactive to TRUE back then.

So this really needs a better implementation in httr2, I think? At least try/catch the browser code and if it fails show the URL so that you don't get stuck?!

@flahn
Copy link
Member

flahn commented Sep 16, 2022

r-lib/httr2#170

Copy link
Member

@flahn flahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requiring httr 0.2.2 now and setting interactive to false for Jupyter now prints URL and device code

@flahn flahn closed this Sep 29, 2022
@flahn flahn reopened this Sep 29, 2022
@flahn flahn marked this pull request as ready for review September 29, 2022 12:48
@flahn flahn merged commit c321d25 into develop Sep 29, 2022
@m-mohr m-mohr deleted the m-mohr-patch-1 branch September 29, 2022 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants