Learn R Programming

EDIutils (version 3.0.1)

login: Login to the EDI repository

Description

Login to the EDI repository

Usage

login(userId = NULL, userPass = NULL, key = NULL, config = NULL)

Value

(NULL) No return value. The token or API key is written to its respective environment variable.

Arguments

userId

(character) User identifier of an EDI data repository account.

userPass

(character) Password of userId

key

(character) EDI-API access key.

config

(character) Path to config.txt, which contains userId and userPass or key (see details below)

Details

If userId, userPass, key, and config are NULL, the console will prompt for credentials.

config: Supplying credentials in a file named config.txt facilitates authentication within automated/unassisted processes. Contents of this file should be new line separated and have the form "<argument> = <value>" (e.g. userId = myname or key = my_api_key).

See Also

Other Authentication: logout()

Examples

Run this code
if (FALSE) {

# Interactively at the console
login()
#> EDI-API key (leave blank to use username/password): "my_api_key"

# Programmatically with an API key
login(key = "my_api_key")

# Programmatically with legacy function arguments
login(userId = "my_name", userPass = "my_secret")

# Programmatically with a file containing credentials
login(config = paste0(tempdir(), "/config.txt"))
}

Run the code above in your browser using DataLab