Configure Okta with OpenID Connect
Overview
This guide walks you through configuring Okta as an authentication provider for Posit Workbench using OpenID Connect (OIDC), and setting up automatic user provisioning. Where possible, Posit recommends using OIDC with Workbench to enable the most features (for example, integration with Azure and AWS Managed Credentials).
What you will accomplish
By the end of this guide, your Workbench server will:
- Authenticate users against Okta using OIDC.
- Automatically provision user accounts and home directories using SCIM or JIT provisioning.
Prerequisites
Before you begin, ensure you have:
- Workbench installed and accessible.
- Administrative access to Okta with permission to create and modify applications.
- Administrative command line access to the Workbench server.
- Sudo privileges on the Workbench server.
- A valid SSL certificate with verified HTTPS access for Workbench. If you use an external proxy or load balancer, configure the front-door address with an SSL certificate.
If you plan to use SCIM for user provisioning, you also need:
- A publicly trusted Certificate Authority (CA) signed certificate. Self-signed certificates are not supported for SCIM.
- Network connectivity between your Posit servers and the Okta service, with port 443 (HTTPS) open.
If you are configuring SCIM and use the Slurm launcher, additional networking considerations apply. See Integrating with Slurm for details.
Choose a user provisioning strategy
Workbench supports two automatic user provisioning methods: Just-in-Time (JIT) and System for Cross-domain Identity Management (SCIM).
Comparison
| JIT | SCIM | |
|---|---|---|
| Setup complexity | Lower | Higher |
| User provisioning | Automatic | Automatic |
| User deprovisioning | Manual | Automatic |
| Group sync with names | Supported | Supported |
| Group sync with Linux group IDs (GIDs) | Not supported | Supported |
| Requires CA-signed TLS certificate for Workbench | No | Yes |
| Requires inbound HTTPS from Okta to Workbench | No | Yes |
Use JIT if
- You want a simpler setup with fewer prerequisites.
- You cannot configure HTTPS with a publicly trusted, CA-signed certificate for Workbench.
- Your Workbench deployment cannot receive inbound connections from Okta.
- You are comfortable with manual user deprovisioning.
- You do not need Workbench GIDs to be synced from Okta groups.
Use SCIM if
- You need Okta to centrally manage the full user lifecycle, including creation, updates, and automatic deactivation.
- You need Workbench GIDs to be synced from Okta groups.
- Your environment already meets the additional requirements: a CA-signed TLS certificate, and inbound HTTPS from Okta to the Workbench SCIM API endpoint at
https://<workbench-hostname>/scim/v2.
The rest of this guide shows JIT instructions by default. If you choose SCIM, select SCIM from the Provisioning selector below. Your selection is saved in your browser and persists across visits.
Configure authentication
Both provisioning strategies require OIDC authentication. Complete these steps before you configure user provisioning.
Step 1: Create the Okta application
- In Okta, go to Applications > Browse App Catalog.
- Search for Posit Workbench.
- Select Add Integration to add Workbench to your organization.
- Assign the users or groups that should have access to Workbench.
- From the Posit Workbench App > General tab, in the App Settings section, select Edit.
- In the Workbench Base URL box, enter the base URL of your Workbench server without the
https://prefix (for example,workbench.example.com), then select Save. - Go to the Posit Workbench App > Sign On tab.
- Under Sign on methods:
- Select OpenID Connect.
- Set Application username format to Email prefix.
- Select Done.
- From the Sign On tab, copy the Client ID and Client secret. You will use these values when you configure Workbench.
- Copy the URL for OpenID Provider Metadata. You will use this URL when you configure Workbench.
Step 2: Encrypt the client secret
On the Workbench server, encrypt the client secret you copied in Step 1. For more details, see Encryption.
Terminal
sudo rstudio-server encrypt-passwordPaste the plaintext client secret when prompted. Save the encrypted value. You will use it in Step 3.
Step 3: Configure Workbench for OIDC authentication
On the Workbench server, create
/etc/rstudio/openid-client-secretwith the following content. Replace the placeholders with the Client ID from Step 1 and the encrypted client secret from Step 2:/etc/rstudio/openid-client-secret
client-id=<your-client-id> client-secret=<your-encrypted-client-secret>Set permissions on the file:
Terminal
sudo chmod 0600 /etc/rstudio/openid-client-secret sudo chown rstudio-server:rstudio-server /etc/rstudio/openid-client-secretIn a web browser, open the OpenID Provider Metadata URL you copied in Step 1. The URL returns a JSON document containing the Okta OpenID configuration.
In the JSON document, locate and copy the
issuervalue (for example,https://<your-okta-tenant>.okta.com). You will use it in the next step.Open
/etc/rstudio/rserver.confand add the following lines. Replace<issuer-url>with the issuer value from Step 4:/etc/rstudio/rserver.conf
# Enable OpenID Connect authentication auth-openid=1 # Configure Okta as the OpenID provider auth-openid-issuer=https://<your-okta-tenant>.okta.com # Configure the username claim auth-openid-username-claim=preferred_usernameRestart the Workbench services:
Terminal
sudo systemctl restart rstudio-server sudo systemctl restart rstudio-launcherVerify that Workbench restarted successfully:
Terminal
sudo systemctl status rstudio-server
Users assigned to the Workbench application in Okta can now authenticate, but they cannot start sessions until you configure user provisioning.
Set up user provisioning
Workbench requires users to have local or networked system accounts. These need to be Linux users complete with home directories.
The following instructions are for JIT provisioning. To view SCIM instructions instead, select SCIM from the Provisioning selector in the Choose a user provisioning strategy section.
The following instructions are for SCIM provisioning. To view JIT instructions instead, select JIT from the Provisioning selector in the Choose a user provisioning strategy section.
Step 1: Configure Workbench for user provisioning
JIT
Open the Workbench configuration file
/etc/rstudio/rserver.confto edit it for JIT.Add the following lines:
/etc/rstudio/rserver.conf
# Enable user provisioning user-provisioning-enabled=1 # Enable user provisioning with JIT registration instead of SCIM user-provisioning-register-on-first-login=1 # Enable Pluggable Authentication Modules (PAM) sessions for home directory creation auth-pam-sessions-enabled=1 # Optional: Configure starting UID (default is 1000) #user-provisioning-start-uid=1000 # Optional: Set custom home directory path (default is /home) #user-homedir-path=/mnt/home
SCIM
Open the Workbench configuration file
/etc/rstudio/rserver.confto edit it for SCIM.Add the following lines:
/etc/rstudio/rserver.conf
# Enable user provisioning user-provisioning-enabled=1 # Enable Pluggable Authentication Modules (PAM) sessions for home directory creation auth-pam-sessions-enabled=1 # Optional: Configure starting UID (default is 1000) #user-provisioning-start-uid=1000 # Optional: Set custom home directory path (default is /home) #user-homedir-path=/mnt/home
Step 2: Configure home directory creation
Workbench relies on PAM to create user home directories. Configure your operating system accordingly.
Terminal
# Install the PAM mkhomedir module if not already installed
sudo apt update
sudo apt install -y libpam-modules
# Configure automatic home directory creation
echo -e "\n# Posit Workbench: automatic home directory creation\nsession required pam_mkhomedir.so skel=/etc/skel/ umask=0077" | sudo tee -a /etc/pam.d/common-sessionTerminal
# Install required packages
sudo dnf install -y oddjob-mkhomedir authselect
# Enable the oddjobd service for home directory creation
sudo systemctl enable --now oddjobd.service
# Enable the home directory creation feature
sudo authselect enable-feature with-mkhomedir
sudo authselect apply-changesStep 3: Configure NSS module
Workbench includes a Name Service Switch (NSS) module that allows the operating system to resolve usernames based on the Workbench user service.
Verify the NSS module is installed:
Terminal
ls -l /usr/lib/x86_64-linux-gnu/libnss_pwb.so.2Modify the
/etc/nsswitch.confNSS configuration file linespasswd,group, andshadowto includepwbif the file does not already list it:/etc/nsswitch.conf
passwd: files systemd pwb group: files systemd pwb shadow: files pwb
If you have System Security Services Daemon (SSSD) or Active Directory configured, ensure pwb appears before sssd in the configuration to prioritize Workbench users.
Verify the NSS module is installed:
Terminal
ls -l /usr/lib64/libnss_pwb.so.2Create a custom authselect profile:
Terminal
sudo authselect create-profile pwb --base-on=minimal
If you have SSSD configured, use --base-on=sssd instead of --base-on=minimal.
Modify the
passwd,group, andshadowlines to includepwbin the profile configuration/etc/authselect/custom/pwb/nsswitch.conf:/etc/authselect/custom/pwb/nsswitch.conf
passwd: files {if "with-altfiles":altfiles }systemd pwb {exclude if "with-custom-passwd"} group: files {if "with-altfiles":altfiles }systemd pwb {exclude if "with-custom-group"} shadow: files pwb {exclude if "with-custom-shadow"}
If you have SSSD or Active Directory configured, ensure pwb appears before sssd in the configuration to prioritize Workbench users.
Activate the profile:
Terminal
sudo authselect select custom/pwb with-mkhomedir sudo authselect apply-changes
Step 4: Disable NSCD caching
Name Service Cache Daemon (NSCD) caching can interfere with the Workbench user provisioning process. Disable it for user and group lookups. Workbench user provisioning implements its own caching mechanism.
First, check if you are using NSCD:
Terminal
sudo systemctl status nscdIf NSCD is installed and running, make the following changes.
Add or modify these lines:
/etc/nscd.conf
enable-cache passwd no enable-cache group noRestart NSCD:
Terminal
sudo systemctl restart nscd
Enable SCIM provisioning
Step 1: Generate the SCIM authentication token
Workbench uses a bearer token to authenticate SCIM requests from Okta.
Generate a token and copy the value:
Terminal
sudo rstudio-server user-service generate-token "Okta User Provisioning Token"Store this token securely. Anyone with this token can create, modify, or delete users in Workbench.
Step 2: Configure Okta SCIM provisioning
The Okta Marketplace integration for Posit Workbench does not support user provisioning with SCIM. You must create a separate app integration for user provisioning. This second app integration must use SAML, because Okta custom OIDC applications do not support user provisioning. See this Okta support article for details.
- In Okta, go to Applications > Create App Integration.
- Select SAML 2.0.
- Enter a name such as Posit Workbench SCIM (choose any name, but make it clear that this integration is for SCIM).
- Fill out the following SAML Settings:
- Single sign-on URL:
https://<workbench-hostname>/saml/acs(includehttps://) - Audience URI (SP Entity ID):
https://<workbench-hostname>/saml/metadata(includehttps://) - Name ID format:
Unspecified - Application username:
Email prefix
- Single sign-on URL:
- Select the General tab.
- Select Edit in the App Settings section and check Provisioning: SCIM.
- Select the Provisioning tab.
- Select Integration.
- Select Edit in the SCIM Connection section.
- Configure the following settings:
- SCIM connector base URL:
https://<workbench-hostname>/scim/v2 - Unique identifier field for users:
userName - Supported provisioning actions: select Push New Users, Push Profile Updates, and Push groups.
- Authentication Mode: select HTTP Header. In the Authorization box, paste the token from Step 1. Select Test Connector Configuration to verify the connection.
- SCIM connector base URL:
- If the test succeeds, select Save.
- Select the To App tab.
- Select Edit.
- Enable Create Users, Update User Attributes, and Deactivate Users.
- Select Save.
Step 3: (Optional) Configure Okta SCIM group provisioning
Okta can synchronize groups assigned to the Workbench application. This is optional but recommended if you use groups for access control.
- Select the Push Groups tab.
- Select + Push Groups.
- Find the group you want to push and select Save.
- If successful, the Push Status changes to Active.
Restart Workbench
Restart Workbench to apply the configuration changes.
Terminal
sudo systemctl stop rstudio-server
sudo systemctl stop rstudio-launcher
sudo systemctl start rstudio-launcher
sudo systemctl start rstudio-serverVerify that Workbench has restarted successfully:
Terminal
sudo systemctl status rstudio-server
sudo systemctl status rstudio-launcherVerification
After completing configuration, test that authentication and provisioning work correctly and that Workbench starts successfully without error messages.
In Okta, assign a test user to the Workbench application.
Have the test user navigate to the Workbench URL and sign in using their Okta credentials.
After the user’s first successful sign-in, verify that Workbench created the account:
Terminal
sudo rstudio-server list-usersThe test user should appear in the output.
Verify that the user can start a session successfully.
In Okta, assign a test user to the Workbench application.
Verify that Workbench provisioned the user:
Terminal
sudo rstudio-server list-usersThe test user should appear in the output.
Have the test user navigate to the Workbench URL and sign in using their Okta credentials.
Verify that the user can start a session successfully.
Troubleshooting
Use the pamtester utility for additional testing:
Terminal
/usr/lib/rstudio-server/bin/pamtester --verbose rstudio <user> authenticate acct_mgmt setcred open_session close_sessionIf you encounter any issues, open a ticket with Posit Support. Include a copy of your diagnostic output, any error messages, and screenshots of your configured applications in Okta.