Comments (10)
The following env vars (Sys.getenv()
) are likely to be useful (tested on Ubuntu):
SSH_CONNECTION
- (only present if there is one)
RSTUDIO
- (present for both server and desktop)
RSTUDIO_HTTP_REFERER
- (present for rstudio server only)
from boxr.
I was actually looking forward on using box-r on rstudio server.
Since Linux doesnt have a box.com client, this was a excellent solution to this, specially since all the data i want to grab is for a shiny app.
Alas! Will have to wait until you figure this out.
Thanks for the package!
from boxr.
In the meantime, you could try setting up your account on a local machine, and then copying over the generated token file (~/.boxr-oauth
) to the same place on the server. Once you've done this, running box_auth()
from rstudio-server should detect it and authorise you. I haven't tested this myself, but I've seen it discussed as a work-around for other OAuth2.0/httr packages. Let me know how you get on!
from boxr.
Thanks for the tip. I registered on a windows laptop i had around and got the .box-auth.
But it didnt work all the way to validate me.
First of all, it didnt work just copying the .box-oauth. Besides de .boxr-oauth i needed to copy ~/.Renviron as well (was a file with only two lines that contained my box id and box secret).
After that, here are my results:
library(boxr)
Welcome to boxr 0.2.9!
Bug reports: https://github.com/brendan-R/boxr/issues
box_auth()
Reading client id from .Renviron
Reading client secret from .Renviron
Auto-refreshing stale OAuth token.
Error in refresh_oauth2.0(self$endpoint, self$app, self$credentials) :
client error: (400) Bad Request
Can you point me out to the page where you saw this workaround? perhaps i could read a bit from them to see if i needed to do something else.
Thanks!
from boxr.
Well, what do you know.
I tried again and this time it did work.
- Refresh on PC
- Right away copy token
- box_auth()
library(boxr)
Welcome to boxr 0.2.9!
Bug reports: https://github.com/brendan-R/boxr/issues
box_auth()
Reading client id from .Renviron
Reading client secret from .Renviron
boxr: Authenticated at box.com as XXX XXXXX ([email protected])
wonder if i will able to refresh from rstudio now.
Thanks for the pointers! w/o your guidance i would be stuck! Keep the good work and i hope you can sort this hurdle in the near future!
from boxr.
Very glad it worked!
Based on my (wobbly) understanding of OAuth2.0, if auth'ing via two machines does give you problems, setting up separate 'Apps' at box.com (and using separate tokens) is likely to stop this happening. This is more of an issue with API design than the R package I'm afraid.
from boxr.
Hi Brendan, do you have any progress on this?
I am trying to use it without needing to open the browser and click "yes" to authorize.
from boxr.
I'm afraid having to do the browser part somewhere is the essence of OAuth2.0; there's no way around it with the box.com API.
The token-copying method described above, while annoyingly manual, seems to be the recommended behaviour for similar packages, such as rdrop2. It seems that the googlesheets team made some progress towards making the token-copying part unnecessary, but it doesn't look like it's quite a solved problem yet (though I may be mistaken). I have a suspicion that you'd need to get into the internals of rstudio-server
itself to make it work properly.
I'm afraid I'll be unable to spend significant time on this in the near term, but if it's a pressing need for you and you'd like to have a crack at it, I'd be happy to consider a pull request.
from boxr.
Got it. Thanks. Great job on this package. :-)
from boxr.
Copy and paste method described here (h/t @nwstephens):
https://support.rstudio.com/hc/en-us/articles/217952868
from boxr.
Related Issues (20)
- box_file_update()
- Rebuild testing HOT 4
- shinyapps.io HOT 5
- Unable to access public document HOT 9
- SUGGESTION: Allow specifying a box file_id in box_write HOT 4
- box_ul issue - Error: $ operator is invalid for atomic vectors HOT 17
- Can I get a listing of a shared link? HOT 4
- box_fresh_auth() Error: `cache` must be a valid filename HOT 20
- Delete
- Error when deploying shinyapp with boxr HOT 1
- No prompt to enter token after box_auth() HOT 2
- Read file using Box file path HOT 4
- Question: How to use boxr that uses SAML/Okta authentication HOT 10
- Functions to manipulate shared links HOT 1
- Better token location
- [Question]: Is it possible to use boxr to upload to S3 HOT 1
- What redirect URI to use? HOT 4
- boxr redirect_uri_mismatch Error HOT 1
- redirect_uri_mismatch error even after setting redirect_uri to `http://localhost:1410/`
- Adding tags
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boxr.