Changes in version 0.7.0 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). Features - 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). - The inactivity warning dialog is styled with classes (.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). Changes - 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). Changes in version 0.6.0 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. Upgrade notes - Remembered devices must pass 2FA once more. Device tokens are now stored hashed; the clear-text tokens of earlier versions can no longer match a cookie and are deleted when the database is migrated. - An idle session of a self-refreshing app (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. Security - Session tokens come from a cryptographic generator (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. - Password throttling: after 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. - 2FA limits: at most 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. - Revocation closes open sessions: a session whose token is removed is sent back to the access page (at once via revoke_sessions(), otherwise within 30 s), whatever the timeout setting. - Pushover user keys are stored with authenticated encryption (libsodium secretbox, XSalsa20-Poly1305) instead of unauthenticated AES-CBC: a tampered value or a wrong 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). - Device cookie: scoped to the app's path instead of /, Secure over https, configurable name (secure_app_local(device_cookie = )); the database stores the SHA-256 of the device token (new hashed column). Features - revoke_sessions(user_id, except = NULL) and current_token(session). - User management without SQL: get_user(), set_password() (revokes the user's other sessions by default), set_role(), set_twofa(), count_devices(), forget_devices(), delete_user(). - Warning before the inactivity timeout: 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. Bug fixes and efficiency - 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. - authlas scripts and styles are served from versioned URLs, so browsers do not keep running cached copies after an upgrade. - Session tokens are freed: 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. - The schema migration runs once per process and database instead of on every user lookup (two ALTER TABLE per login and per 2FA send). - Expired device tokens are purged when a device is added or checked. - send_2fa() reports why Pushover failed (app token, user key and code redacted). Changes in version 0.5.0 Features - 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. Bug fixes - 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. - The local variant now records the language set in secure_app_local(language = ) in the session (and the post-login URL) instead of always using "en". - duckdb >= 2.0: connections are opened with a per-session home and extensions disabled (authlas needs neither), so authlas no longer writes to the shared ~/.duckdb nor prints the storage advisory on every connection. Older duckdb versions are used as before. Tested with duckdb 2.0.1. Internal - The internal send_2fa() gains a message argument; code that stubs it (e.g. the demo in inst/examples/local_auth.R) should accept .... Changes in version 0.4.1 Changes - The local/server two-factor step now allows 3 code attempts (was 5) before returning the user to the login screen, and each failed attempt reports how many tries remain. Issuing a fresh code (re-login or Resend) resets the counter. The cap is still configurable via secure_server_local(max_attempts = ...). Changes in version 0.4.0 Breaking changes - The package has been renamed from 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). - The master-key environment variable is now AUTHLAS_KEY. The legacy SHINYMANAGER_KEY is still read as a fallback when AUTHLAS_KEY is unset, so existing deployments keep working. - Bundled assets are now served from the 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. Changes in version 0.3.0 Features - Two-factor authentication is now optional per user in the local/server variant. Each user has a 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). - The "remember this device" lifetime is now configurable per user via the 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). - Databases created by earlier versions are migrated automatically: the new columns are added on first open (ALTER TABLE ... ADD COLUMN IF NOT EXISTS), so existing user stores keep working without being recreated. Changes in version 0.2.2 Fixes - Authentication screens are now built with 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. - The theme argument of secure_app_external() / secure_app_local() is deprecated and ignored (Bootstrap no longer applies to the auth page). - Auth assets are injected via an htmlDependency so they reach the document under muiMaterialPage(). - Examples and README now build the protected app UI from muiMaterial components too, instead of fluidPage(). Changes in version 0.2.1 Fixes - The local/server example (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". Changes in version 0.2.0 New features - All authentication UI is now built with muiMaterial (Material UI via shiny.react). - Two access variants share one package: - webR / external — 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. - local / server — credential login + Pushover two-factor authentication: - 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). - 6-digit Pushover code valid 30s with attempt limiting, six-cell input widget, and a per-device "remember for 24h" cookie that skips 2FA. Infrastructure - Server-variant dependencies (DBI, duckdb, sodium, openssl, pushoverr) are Suggests loaded via requireNamespace(), so the package still installs in webR; muiMaterial and jsonlite are now Imports. - Added package-level @import shiny (fixes server functions that referenced shiny functions unqualified). - Tests added: test-crypto, test-local-auth, test-2fa-flow (testthat edition 3, Pushover mocked). Changes in version 0.1.1 - Fixed external domain authorization when only allowed_domains is supplied. - Fixed server-side auth state restoration after the UI token gate accepts a session token. Changes in version 0.1.0 - Initial lightweight fork for Shiny apps running with webR/WebAssembly. - Authentication is delegated to an external identity provider such as Auth0. - Added secure_app_external(), secure_server_external(), and check_credentials_external(). - Kept the shinymanager visual container, language labels, session token gate, and floating logout button. - Removed classic username/password login, SQLite/SQL credential storage, admin panel, password management, and related heavy dependencies.