Skip to contents

Authenticates using the BrAPI /token endpoint and returns an updated connection object with the Bearer token set.

Usage

brapi_login(con, username, password)

Arguments

con

A brapi_connection() object.

username

Character. Your username.

password

Character. Your password.

Value

A new brapi_con object with the token populated.

Examples

# \donttest{
con <- brapi_connection("https://test-server.brapi.org")
con <- brapi_login(con, "brapi_reader", "brapi_reader")
#>  Logged in to <https://test-server.brapi.org>
con
#> 
#> ── BrAPI Connection 
#> • Server: <https://test-server.brapi.org>
#> • Version: v2
#> • Auth: ✓ authenticated
#> • Page size: 1000
#> • Timeout: 120s
#> • Cache: disabled
# }