This function provides several options for ways in which user credentials (i.e., a user name and password) may be collected in R. The intent here is for use cases where some sort of authentiation is necessary within R, such as database connection credentials.
get_credentials(prompt = "", username = guess_user(), toggle_cache = TRUE, preferences = get_recommended_credentialer()) get_credentials_via_readline(prompt = "", username = guess_user(), plain_text = FALSE, toggle_cache = TRUE) get_credentials_via_rstudioapi(prompt = "", username = guess_user(), toggle_cache = TRUE) get_credentials_via_shiny(prompt = "", username = guess_user(), toggle_cache = TRUE) get_credentials_via_tcltk(prompt = "", username = guess_user(), toggle_cache = TRUE)
prompt | Character. A prompt justifying why a user ought to provide a password, or perhaps indicating what the password is needed for. |
---|---|
username | Character. The username that will be used in conjunction with the provided password |
toggle_cache | Logical. Used only in the |
preferences | Character. An ordered list of preferred credentialing options. The first
option on the list that is functional on the user's system will be used. Note that in the
event that none of the preferred options is available on a user's system, then all
available options (per |
plain_text | Logical. Available only for the |
Generally get_credentials
is a better choice for packages to use than one of the
specific credential getters. The order in which options are considered is controllable
via the preferences
argument, but there are safeguards adapt to the urser's system.