A company called Appsilon has worked on such topic see this article
That presents two
for this use case.
Authentication and user roles mechanism in your app are also dependent on where you host, and what authentication scheme you want. For example, you can deploy in a shiny server but behind a reverse proxy that does the authentication. If the user is not allowed to view the app, the reverse proxy won't let him pass.
You can also use pro product from RStudio. RStudio Connect has built-in support for private app.
You'll also find different solution on the web if you search for this topic.
Hope it helps