Set Up RStudio Pro
To set up RStudio Pro to connect to LabKey, follow the instructions and guidance in this topic:
Once RStudio Pro is correctly configured, RStudio Pro Admin enables proxy authentication on RStudio to use LabKey as the authenticator. Some key steps:
1. Customize Proxy Token
sudo sh -c "echo 'X-Secret-User-Header' > /etc/rstudio/secure-proxy-user-header"
sudo chmod 0600 /etc/rstudio/secure-proxy-user-header
2. Edit rserver.conf
Add the following two lines to /etc/rstudio/rserver.conf:
Restart RStudio Pro so that these configuration changes are effective by running
$sudo rstudio-server restart
Configure RStudio Pro in the Admin Console
- Select (Admin) > Site > Admin Console.
- Click Settings.
- Under Configuration, click Site Settings.
- Set the Base Server URL (i.e. not "localhost").
- Click Save.
- Click Settings
- Under Premium Features, click RStudio Settings.
- Enter the Configuration values:
- RStudio Pro URL: The absolute URL of RStudio Pro.
- User Email Suffix: Used for LabKey to RStudio Pro user mapping. The RStudio Pro user name is derived from removing this suffix (Ex. "@labkey.com") from the user's LabKey Server email address.
- Security Token: The HTTP header name that RStudio is configured to use to indicate the authenticated user. Default is 'X-RStudio-Username'.
- Initialize Schema Viewer: Check the box to enable the viewing of the LabKey schema from within RStudio. See Advanced Initialization of RStudio for more information.
Testing RStudio Pro Connection
Troubleshooting unsuccessful results from Test RStudio Pro
- An error response may indicate the incorrect URL for RStudio Pro was entered, or that URL is unreachable. Try reaching the URL in a browser window outside of LabKey.
- A warning response may have several possible causes:
- Configuration is correct, but user is not a valid RStudio user. A user might be a valid Linux user, but not an RStudio user. Does the user have the home directory set? See Add RStudioPro Users for help.
- A bad user email suffix
- A bad security token
- A success response means the configuration is good and current LabKey users can now log in to the RStudio Pro server.
Launch RStudio Pro
- Select (Admin) > Developer Links > RStudio Server.
When you launch RStudio Pro, you will see your home page. If you have multiple sessions, click on one to select it.
Now you can use RStudio Pro to edit R reports and export data. Learn more in these topics: