Present the user with a login interface before the exam begins.
password_auth()
requests the user to enter a username and password.
ui_token_auth()
requires the user to enter only an access token.
password_auth(
users,
username_label = "Username",
password_label = "Password",
title = "Login",
button_label = "Login",
username_empty = "Username cannot be empty.",
password_empty = "Passwort cannot be empty.",
unauthorized = "The username/password are incorrect."
)
ui_token_auth(
users,
token_label = "Access token",
title = "Login",
button_label = "Login",
token_empty = "Access token cannot be empty.",
unauthorized = "The token is incorrect."
)
a data frame with user authentication information. See below for details.
label for the username input field.
label for the password input field.
title of the dialog.
label for the login button.
error messages for empty username field.
error messages for empty password field.
error message for incorrect username/password.
label for the token input field.
error messages for empty token field.
The password_auth()
authentication provider
matches the given username and password against columns username and password in data frame users
.
The password column must contain hashed passwords created with sodium::password_store()
(e.g., sodium::password_store("password")
, or a SHA-256 HMAC created with digest::hmac()
(digest::hmac("exam_id", "password", algo = "sha256")
).
The ui_token_auth()
authentication provider
matches the given token and against column token in data frame users
.
The token can be any character data.
For both authentication providers, if the users
data frame also contains columns display_name
and/or grading, they are added to the user object
(and used as described in the authentication provider documentation).
Other access configuration:
authentication_provider
,
configure_attempts()
,
rsconnect_auth()