Compatible additions so apps no longer need SQL on authlas' tables nor
!important to restyle the inactivity warning. Databases of 0.6.0 work as they
are (no schema change).
list_users(db, role = NULL): every user's public data as a data frame (the
fields of get_user() except profile), ordered by name or email, optionally
only one role (case-insensitive). Never the password hash nor the key.set_name(db, user, name): change the display name (trimmed; NULL, NA or
"" remove it, so the login uses the email).get_pushover_key(db, user): the user's decrypted Pushover key, or NULL, for
the app's own notifications or to show it masked. It is a secret: server-side
only. A key in the pre-0.6 format is rewritten in the current one on the way
(only if it decrypts to plausible text).check_password(db, user, password, lockout = TRUE): verify the current
password of a known user (user_id or email), sharing the login's failure
counter and lockout; while locked it returns FALSE with attribute
"locked_minutes". Unknown users take the same time (dummy hash)..authlas-timeout,
__dialog, __text, __actions, __button) and CSS variables
(--authlas-timeout-*) from the new timeout.css, all with zero specificity
(:where()), instead of inline styles. Same look by default; any app rule
wins without !important. The box now has aria-labelledby /
aria-describedby. Note: generic app rules win too (e.g. with Bootstrap the
button text is no longer upper case).set_user_settings(db, user, ...) takes a user_id or an email, like the rest
of the user API, returns the user_id invisibly, and stops if the user does
not exist (it used to do nothing). email = still works as a deprecated alias
(warning once per R session).Security and robustness review. Existing databases keep working without manual migration: new tables and columns are added automatically the first time a process uses the database.
invalidateLater, reactivePoll)
now times out as configured; before, every refresh renewed it.add_user() stores emails trimmed and in lower case, and refuses an email that
differs from an existing one only in case.send_2fa() (internal) now warns when a code cannot be delivered.openssl::rand_bytes())
instead of sample(), which was predictable and affected by set.seed().
Without openssl (webR) a fallback independent of the app's seed is used.max_login_failures (default 5) failures for an
email (new login_attempts table, so it survives reloads and sessions) or in a
session, logins are refused for lockout_minutes (default 15) without hashing.
The response is the same for unknown emails, which are verified against a
dummy Argon2id hash so timing does not reveal which accounts exist. New
message login_locked.max_resends (default 3) resends per login and
max_sends (default 5) codes per user within send_window_minutes
(default 15; new twofa_sends table). Beyond them the user returns to the login
screen.revoke_sessions(), otherwise within
30 s), whatever the timeout setting.AUTHLAS_KEY is now an error instead of garbage. Keys in the
old format are still read, are rewritten in the new one after the first
successful 2FA send, and reencrypt_secrets(db) rewrites them all at once
(run it with the same AUTHLAS_KEY they were encrypted with)./, Secure over https,
configurable name (secure_app_local(device_cookie = )); the database stores
the SHA-256 of the device token (new hashed column).revoke_sessions(user_id, except = NULL) and current_token(session).get_user(), set_password() (revokes the
user's other sessions by default), set_role(), set_twofa(),
count_devices(), forget_devices(), delete_user().timeout_warning minutes before it
(default 1, at most half the timeout; 0 disables) a dialog counts down the seconds left, with a button
that keeps the session open (any activity does the same). New messages
timeout_warning and timeout_continue in local_messages(); labels in the
11 languages for the external variant. The session check is now scheduled for
the warning and the deadline instead of every 30 s, so sessions close on time.logout_button = FALSE in secure_app_local() / secure_app_external() hides
the floating logout button; logout(session) does what the button does.timeout.js counts only real user activity (mouse, keyboard, wheel, scroll,
touch), at most one notice every 15 s on the same .shinymanager_timeout
input. Shiny's internal events no longer renew the session nor send a message
per recalculated output. The unused Object.assign polyfill is gone.remove() clears all of their data, a session's
token is removed when the session ends (except with keep_token = TRUE), and
invalid or repeated tokens are no longer recorded on every page load.ALTER TABLE per login and per 2FA send).send_2fa() reports why Pushover failed (app token, user key and code
redacted).Custom login and 2FA screens. secure_app_local() gains login_ui and
twofa_ui: pass a UI tag or a function (a twofa_ui function receives
twofa_window). Apps no longer need to copy secure_app_local() and reach for
internals (.tok, fab_button(), ...) to restyle the access page. The ids a
custom screen must carry are documented in ?local-screens, and a warning
names any required id that is missing.
New exported building blocks: local_login_ui() and local_twofa_ui() (the
default screens, now with editable texts), local_twofa_cells(),
local_twofa_timer() and local_centered().
secure_app_local() and secure_app_external() gain page_args, passed to
muiMaterial::muiMaterialPage() for the authentication page. Use e.g.
page_args = list(useMaterialIconsFilled = TRUE) when a custom screen uses
Material Icons; the auth page only loads Roboto by default.
Configurable messages. secure_server_local(messages = list(...)) overrides
any of the error texts and the Pushover body; local_messages() lists them and
rejects unknown names. Defaults are unchanged (Spanish).
Enter submits the login form and the 2FA code. Before every login submit (Enter or click) the current field values are pushed to the server, so the 250 ms debounce of muiMaterial text fields can no longer lose the last keystrokes (or a password-manager autofill).
The error outputs sm_login_error and sm_twofa_error are no longer
suspended while hidden, so custom screens receive them even when they hide
those elements.
device-cookie.js: the shinymanager_clear_device_cookie handler took no
argument, which Shiny rejects ("handler must be a function that takes one
argument"); it now registers correctly and the console error is gone.secure_app_local(language = )
in the session (and the post-login URL) instead of always using "en".~/.duckdb nor prints the storage advisory on every connection. Older duckdb
versions are used as before. Tested with duckdb 2.0.1.send_2fa() gains a message argument; code that stubs it (e.g.
the demo in inst/examples/local_auth.R) should accept ....secure_server_local(max_attempts = ...).shinymanager.webr to authlas and is now a standalone
package (no longer presented as a fork of shinymanager, from which it was originally derived,
GPL-3). Update library(shinymanager.webr) to library(authlas).AUTHLAS_KEY. The legacy SHINYMANAGER_KEY is
still read as a fallback when AUTHLAS_KEY is unset, so existing deployments keep working.authlas/ Shiny resource path (was shinymanager/). This
is internal; apps using the public API are unaffected.Internal Shiny input ids, the device cookie (shinymanager_device) and CSS classes are unchanged.
twofa_enabled flag stored in the database; when
FALSE, a valid password logs the user straight into the app with no Pushover
step. Defaults to TRUE (unchanged behaviour).device_ttl_hours column. When a user has no value of their own, the server's
device_ttl_hours argument (default 24) applies.add_user() gains twofa_enabled and device_ttl_hours arguments, and a new
set_user_settings() function updates both for an existing user
(device_ttl_hours = NA clears the per-user override).check_credentials_local() now also returns twofa_enabled and
device_ttl_hours at the top level (kept out of the public user_info).ALTER TABLE ... ADD COLUMN IF NOT EXISTS),
so existing user stores keep working without being recreated.muiMaterial::muiMaterialPage() +
CssBaseline() instead of shiny::fluidPage(), following muiMaterial's
guidance. Previously the Material UI login/2FA/welcome components were rendered
inside fluidPage(), mixing Bootstrap with Material UI; Bootstrap's
html { font-size: 10px } broke MUI's rem-based sizing (e.g. Typography()
rendered too small). Bootstrap is now suppressed on the auth page.theme argument of secure_app_external() / secure_app_local() is
deprecated and ignored (Bootstrap no longer applies to the auth page).htmlDependency so they reach the document
<head> under muiMaterialPage().fluidPage().inst/examples/local_auth.R) is now runnable
out-of-the-box: it sets a default SHINYMANAGER_KEY if none is present,
re-seeds a fresh database each run with create_user_db(overwrite = TRUE),
and prints the 2FA code to the console (demo mode) so the full flow works
without a Pushover account. Previously a first run without SHINYMANAGER_KEY
left an empty database that later runs reused, so the documented credentials
returned "invalid credentials".welcome_panel() adds an editable muiMaterial welcome
screen (logo + free content + access button) for use as the waiting_ui of
secure_app_external(). The button injects a configurable identity, so the
external flow doubles as a "no login" gate.secure_app_local() / secure_server_local() drive a login -> 2FA -> app
flow against a duckdb user store.check_credentials_local() validates email + password and exposes the user
profile (JSON) to the session, never the password hash or Pushover key.create_user_db() / add_user() provision users; passwords are hashed with
Argon2id (sodium) and the per-user Pushover key is encrypted (openssl,
key from the SHINYMANAGER_KEY environment variable).DBI, duckdb, sodium, openssl, pushoverr)
are Suggests loaded via requireNamespace(), so the package still installs in
webR; muiMaterial and jsonlite are now Imports.@import shiny (fixes server functions that referenced
shiny functions unqualified).test-crypto, test-local-auth, test-2fa-flow (testthat
edition 3, Pushover mocked).allowed_domains is supplied.secure_app_external(), secure_server_external(), and check_credentials_external().