ropensci-archive / rfigshare

:no_entry: ARCHIVED :no_entry: An R Interface to 'figshare'
https://docs.ropensci.org/rfigshare
41 stars 12 forks source link

authentication on a headless server #115

Closed adityabandla closed 2 years ago

adityabandla commented 4 years ago

I am trying to use rfigshare to upload files from a remote headless server. Is there a way to get the authentication done without a browser?

muschellij2 commented 4 years ago
  1. Save OAuth Token to RDS
  2. Assign token to oauth:
    token = readr::read_rds("/path/to/token.rds"))
    assign("oauth", token, envir = rfigshare:::FigshareAuthCache)

    Run code.

jhrcook commented 3 years ago

I just made a new article locally using fs_create(), authenticated through the browser, and then moved the ".httr-oauth" file that was created to my remote server. Not much of a fix, but hopefully it helps someone in the future.