Rstudio Registration Key

1 view
Skip to first unread message

Dallas Themshirts

unread,
Aug 4, 2024, 2:27:55 PM8/4/24
to valriredro
Im looking for a user registration/log in code template for r/shiny. It need not be secure, just a way to personalize the content on a shiny app based on previous user settings. I don't want to rely too much on server services (such as accessing cookies)

So far I've been trying to do it myself, using a set of reactive variables (other than the input/output) on the client side, that remember the state of the session. The code became a bit ugly and I wonder if there is something simpler that I can reuse.


Facing the problem like yours I'm developing a package shiny.reglog. It allows anonymous users to look through your app, but also allows user to register. Server-side can access the user id of the logged user for inter-session recognition.


I suspect it is due to something that I forgot or failed to specify in the RStudio Connect configuration file in the Droplet, but as I'm not sure, I preferred to send this email so as not to end up making changes that could compromise the overall functioning of RStudio Connect.


Hello @ac_mattos! This is definitely something we are happy to help with on our Professional Support Team, so you can open a ticket at sup...@rstudio.com ! It's probably worth including a link to this thread so that we can keep everything tied together


In any case, what URL do users go to in their browser to reach the RStudio Connect server? Is it as your server configuration suggests? (Also, you probably want to remove some of the sensitive data, email, IP, etc. out of your config as this is a public site!).


Ultimately, the URL in the confirmation email will be generated based on that Server.Address field, which is why it should be configured to be the "front door" of your server - the URL that users go to in order to access Connect in their browser.


If you are hosting your application behind a proxy at a non-standard path, then yes, that should be right! You should be able to copy and paste the Server.Address into your browser (in an incognito window) and see the RStudio Connect landing page.


RStudio addins provide a mechanism for executing R functions interactively from within RStudio; either through keyboard shortcuts, through the Command Palette or through the Addins menu.


An addin can be as simple as a function that inserts a commonly used snippet of text, and as complex as a Shiny application that accepts input from the user, and later mutates a document open in RStudio.


Executing addinexamples::insertInAddin() directly at the console will insert %in%. RStudio is executing that R script behind the scenes, the addin is providing a user interface element and potentially a shortcut rather than manually writing and executing the function each time.


For addins in particular, a number of methods were added that allow R code to introspect and mutate the contents of a document open in RStudio. These methods are outlined below briefly, but see documentation within the rstudioapi package for more details.


Addins are just R functions, distributed via R packages. The registration file located at inst/rstudio/addins.dcf lets RStudio know which addins are available. Each addin should have the following four fields:


RStudio will automatically discover and register these addins when your package is installed. Any number of addins can be added with a single addins.dcf file, but a blank line must be between each addin that is registered.


Interactive addins are invoked by emitting a call to their function directly into the R console. For addins that display user-interface (e.g. using a Shiny application) this enables users to stop/interrupt them.


Shiny gadgets are Shiny applications which can be registered and run as addins. Typically, a Shiny Gadget provides a mechanism for interactively generating code, or modifying a document, but within this realm the possibilities are endless. This article demonstrates how you might create a simple Shiny Gadget, for more complete documentation see the following articles on the Shiny Developer Center:


The server function used for a Shiny Gadget is similar to one as provided for a regular Shiny application, except with the requirement that your application must respond to the done event. For example,


dialogViewer(): Launch the Shiny Gadget as a modal dialog within the RStudio. Use this when your gadget requires a large amount of screen real estate, but is not heavy-weight enough to require a separate window.


browserViewer(): Launch the Shiny gadget in a separate window. Use this for large Shiny gadgets that require a large amount of real estate, and perhaps are more complex than applications that could fit comfortably within an RStudio modal dialog.


Creating addins with Shiny Gadgets requires shiny, miniUI, and rstudioapi packages from CRAN. To create an addin package, add these packages to the package DESCRIPTION file as follows:


Yes, we offer a full refund for any reason up until June 1st, 2024. From June 2-June 30, cancellations will receive a 50% refund. For cancellations July 1 onwards, no refunds are available. Please contact co...@posit.co if you would like to request a refund for virtual or in-person conference registration, or have any questions.


Disclaimer: This page discusses a Microsoft-developed open source package, which was at version 2.3.4 at the time of this writing. Readers should refer to the Microsoft365R package documentation developed by Hong Ooi for the most up-to-date information.


Microsoft 365 is a subscription extension of the Microsoft Office product line with cloud hosting support. The Microsoft-supported method for interfacing with R is the Microsoft365R package which was developed by Hong Ooi and has extensive documentation. It supports access to Teams, SharePoint Online, Outlook, and OneDrive.


This article describes approaches for authentication to Microsoft 365 using the Microsoft365R R package for use with the Posit professional products. Examples for interacting with data from SharePoint and writing data in pins format to SharePoint are included.


Under the hood, Microsoft365R is using the AzureAuth and AzureGraph packages, also developed by Hong Ooi, for authentication, token management, and access to the Graph API. In some cases, for example with troubleshooting or to remove interactive prompts in scheduled content, calling those packages directly to manage tokens is useful.


Enabling the device code workflow is through the App Registration dashboard in Azure -> click on the created app -> Authentication -> Allow public client flows and setting Enable the following mobile and desktop flows to yes. The device code workflow does not need Redirect URLs. Instead, this method provides a code and a link for the developer to access in a separate browser window (or even on a separate device) for sign-in.


A custom app will need to be registered in Azure with Application permissions. The permissions can be based off of the user permissions but can be assigned as needed for the application and to comply with any security restrictions.


Application permissions are more powerful than user permissions so it is important to emphasize that exposing the client secret directly should be avoided. As a control, using environment variables for storing the client secret is recommended. Connect allows Environment Variables. The variables are encrypted on-disk, and in-memory.


The credentials being embedded can be a user or a service account, as long as access to the desired content inside Microsoft 365 has been granted. Creating service accounts per content is recommended to enable faster troubleshooting and easier collaboration. As a control, the Username / Password should never be exposed directly in the code, instead using Environment Variables. The variables are encrypted on-disk, and in-memory.


The user sign-in flow option provides the typical web browser authentication experience. A user will need to be available to interact with the authentication pop-up in order to which makes this an option for interactive applications (such as the local RStudio IDE, Workbench, or an interactive Shiny app), but not applicable for scheduled content. The details are discussed in the auth vignette.


In some interactive cases it may be easier to use the device code flow where the user is prompted with a code and a link which is opened in a separate screen for logging in. For example for using a Workbench instance that was deployed without an SSL certificate. This does require interaction from the user and as such will not be applicable for scheduled content nor hosted content. The details are discussed in the auth vignette.


For Python users the Microsoft REST API is the Microsoft-developed and recommended method for accessing Microsoft 365 resources. Note that SharePoint access is using the older SharePoint 2013 REST API.


Mapping SharePoint, OneNote, or other systems as a network drive to the hosting server could be considered, using a third-party developed program such as expandrive. Note that this method also relies on application registration and it is unclear to this author how authentication is handled.


RStudio on Amazon SageMaker is a paid product and requires that each user is appropriately licensed. Licenses for RStudio on Amazon SageMaker may be obtained from RStudio PBC directly, or by purchasing a subscription to Posit Workbench on AWS Marketplace. For existing customers of Posit Workbench Enterprise, licenses are issued at no additional cost.


To use an RStudio license with Amazon SageMaker, you must first have a valid RStudio license registered with AWS License Manager. For licenses purchased directly through Rstudio PBC, a licenses grant for your AWS Account must be created. Contact RStudio for direct license purchases or to enable existing licenses in AWS License Manager. For more information about registering a license with AWS License Manager, see Seller issued licenses in AWS License Manager.

3a8082e126
Reply all
Reply to author
Forward
0 new messages