login_sb: Log into ScienceBase with your myUSGS credentials

View source: R/login_sb.R

login_sbR Documentation

Log into ScienceBase with your myUSGS credentials

Description

BE CAREFUL NOT TO POST OR SHARE YOUR PASSWORD! Even better, set up your ~/.R/stream_metab.yaml with fields for sb_user and sb_password so you never again have to bring your password into the R global environment. If that file exists and you call login_sb() with no arguments, the file contents will be used to log you in.

Usage

login_sb(username, filename = "~/.R/stream_metab.yaml")

Arguments

username

Your ScienceBase/myUSGS username, usually an email address

filename

DEPRECATED: The file path to a yaml file where fields for sb_user and sb_password can be found. This file will be ignored if username is given. INSTEAD of relying on a .yaml file, consider installing the secret package, creating a vault, and creating a secret called 'stream_metab' in that vault with fields for sb_user and sb_password. Configure the environment variables USER_KEY and R_SECRET_VAULT so that the defualts work for accessing the 'stream_metab' secret.

Details

Use the same username and password you set up via the ScienceBase interface or your government employer. This function is equivalent to sbtools::authenticate_sb but easier to type.


USGS-R/mda.streams documentation built on June 3, 2023, 8:43 a.m.