Skip to contents

Authenticate directly with email and password and return the raw response containing a token. This is intended for API developers who need a token to authorize requests in the Swagger UI on a remote server, where the normal OAuth browser flow is not available.

Usage

swagger_login(email, password, project_abb, realm = "counts")

Arguments

email

Character. The user's email address.

password

Character. The user's password.

project_abb

Character. The project abbreviation to authenticate against.

realm

Character. The realm to authenticate against (default "counts").

Value

An httr2 response object. On success the body contains the token in data$token.

See also

auth_login() for the standard authentication flow, add_api() to register API endpoints

Examples

if (FALSE) { # \dontrun{
resp <- swagger_login("user@example.com", "password", "myproject")
httr2::resp_body_json(resp)$data$token
} # }