Skip to content

Feature Request: Support for Public Mode with Optional Authentication (Seamless Public-to-Private Transition) #103

@munozedg

Description

@munozedg

Description:
Currently, the auth0 R package requires that the entire Shiny app be wrapped with auth0::shinyAppAuth0(ui, server). This means that as soon as the app is loaded, users are immediately prompted to log in via Auth0, and there is no way to allow anonymous (public) access to the app before authentication.

Problem:

  • Many modern web apps offer a "public" or "demo" mode, where users can explore limited features without logging in, and then choose to log in or register to unlock additional features.
  • With the current design of the auth0 R package, it is not possible to have a seamless transition from public (unauthenticated) to private (authenticated) mode within the same app instance. Wrapping the app with Auth0 always enforces authentication on first load.
  • The only workaround is to deploy two separate apps (one public, one protected), which complicates code maintenance, deployment, and user experience.

Feature Request:

  • Add support for an "optional authentication" mode, where:
    • The app can be loaded and used in a public/anonymous mode by default.
    • The user can choose to log in (e.g., by clicking a "Login" button), at which point the app transitions to authenticated mode and unlocks additional features.
    • The transition should be seamless, without requiring a full reload or redirect to a separate app.

Benefits:

  • Enables best-practice user experience: "try before login."
  • Reduces code duplication and deployment complexity.
  • Aligns with patterns supported by Auth0 in other frameworks (e.g., React, Node, Python).

Example Use Case:

  • A Shiny app that offers a free demo with limited data and features, and unlocks full access after login, all within the same app instance.

Current Workarounds:

  • Deploying two separate apps (public and protected), which is not ideal for maintainability or user experience.

Request:

  • Please consider adding support for optional authentication or a public mode in the auth0 R package, or provide guidance on best practices for achieving this pattern in R/Shiny.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions