Encrypted token to drive_auth in deployed setting–still tries cache
I develop my code on posit workbench. I knit a Rmd file and deploy (“publish with source code”) to rstudio-connect. The Rmd needs to authenticate my google account, and I use googledrive::drive_auth()
. Since I don’t want my auth token shared when I publish the source code, I encrypt the token following the steps outlined here to create an encrypted .rds file. When I want to authenticate, I decrypt the token and pass it to drive_auth
, but drive_auth
fails unless I include the original cached binary file in my deployed resources. Is there a way to prevent that behavior and use only the token that I have encrypted?