start_session: Start Database Session

View source: R/session.R

start_sessionR Documentation

Start Database Session

Description

Login to the database server using pre-established login credentials. This will return a token for the session, which is used in all subsequent calls the the API.

Usage

start_session(
  uname,
  pwd,
  api_baseurl,
  end_point = "/api/auth/login",
  api_url = paste0(api_baseurl, end_point),
  curl_handle,
  ...
)

Arguments

uname

character

pwd

character. See notes for best practices

api_baseurl

character, the base URL for the database server

end_point

character, the API end point for the login

api_url

character, the URL for the database server login

curl_handle

a curl handle created by getCurlHandle(). If one is not provided, it will be created. Please note, it is best practice to establish a curl handle when interacting with an API

...

additional arguments passed to RCurl::getURL()

Details

Best practices are to avoid storing your password in Rscripts that might be shared. To avoid doing this, you can set the credentials in a separate file, and read that file into R to set the login credentials.

Value

list

Author(s)

Matt Espe


fishsciences/telemetry documentation built on May 31, 2024, 10:13 a.m.