Reputation: 1073
I am running an R script
from Terminal
(not RStudio) and at some point I need the user to write the username and password to access an API. For this, I am using a non-safe approach with the following code:
cat('Write username: ')
username<-readLines("stdin", n=1)
cat('Write password: ')
password<-readLines("stdin", n=1)
I have seen there is a nice implementation in RStudio using the rstudioapi
package and the askForPassword
function but since I am running my script from Termianl, I wonder if there is any alternative or more secure way to ask for this information
Upvotes: 0
Views: 638