login_bms: Login to the Server

View source: R/auth.R

login_bmsR Documentation

Login to the Server

Description

Connects to the BMS or related server using a username and password. If these are not provided, a pop-up window will prompt the user to enter their credentials. The function handles authentication and stores the resulting access token internally for subsequent requests.

Usage

login_bms(username = NULL, password = NULL, encoding = "json")

Arguments

username

The username (optional, default is NULL). If not provided, the pop-up window is triggered.

password

The password (optional, default is NULL). If not provided, the pop-up window is triggered.

encoding

Specifies how the request body should be encoded: 'form' (application/x-www-form-urlencoded), 'multipart' (multipart/form-data), or 'json' (application/json). Default is "json".

Value

No return value. The access token is stored internally for future use.

Author(s)

Khaled Al-Shamaa, k.el-shamaa@cgiar.org

Examples

if(interactive()) {
  set_qbms_config("https://bms.icarda.org/ibpworkbench")
  login_bms()
}


icarda-git/QBMS documentation built on Sept. 25, 2024, 10:45 p.m.