Configure Okta SSO Integration for WireGuard
How to integrate Okta SSO with Wiretastix for OIDC-based WireGuard authentication.
Partially verified. The core mechanism – the Org Authorization Server’s app-level Group Claims setting (Step 5) plus the separate Custom Authorization Server Claims-tab path (Step 8) – was checked against Okta’s own developer documentation and is accurate. The exact wording of some UI details (e.g. the “Value: Name vs. Okta Group ID” dropdown in Step 5) hasn’t been independently confirmed. This page’s source is on GitHub at wiretastix/wiretastix-website – if you spot something wrong (or outdated, since Okta’s admin console does change), a pull request is welcome.
This guide will walk you through configuring Okta as your OpenID Connect (OIDC) Identity Provider for Wiretastix, enabling single sign-on (SSO). Okta is an excellent choice for enterprise identity management, offering robust OIDC support with comprehensive group and user management capabilities.
Prerequisites
Before you begin, ensure you have:
- An Okta account (Developer, Workforce Identity, or Customer Identity)
- Administrative access to the Okta Admin Console
- Your Wiretastix instance URL (e.g.,
https://vpn.example.com) - Administrative access to your Wiretastix configuration
Why Okta Works Well with Wiretastix
Okta is particularly well-suited for Wiretastix because:
- Enterprise-grade: Industry-leading identity and access management
- Full OIDC compliance: Complete OpenID Connect 1.0 support
- Group management: Rich group hierarchy and dynamic group support
- Universal Directory: Centralized user and group management
- MFA support: Built-in multi-factor authentication
- Integration ecosystem: Thousands of pre-built integrations
- Excellent documentation: Comprehensive and well-maintained
Step 1: Access the Okta Admin Console
- Sign in to your Okta organization at
https://your-domain.okta.comorhttps://your-domain.oktapreview.com - Click Admin in the top-right corner to access the Admin Console
- Note your Okta domain (e.g.,
dev-12345.okta.comorcompany.okta.com) - you’ll need this later
Step 2: Create an Application Integration
- In the Admin Console, navigate to Applications → Applications in the left sidebar
- Click Create App Integration
- Select the sign-in method:
- Choose OIDC - OpenID Connect
- Select the application type:
- Choose Web Application
- Click Next
Step 3: Configure Application Settings
General Settings
- Fill in the application details:
- App integration name:
Wiretastix VPN - Logo: (Optional) Upload your organization’s logo
- App integration name:
Sign-in redirect URIs
- Add the redirect URI:
- Click + Add URI
- Enter:
https://vpn.example.com/callback - Replace
vpn.example.comwith your actual Wiretastix domain
Sign-out redirect URIs
- (Optional) Add sign-out redirect:
- Click + Add URI
- Enter:
https://vpn.example.com
Assignments
Select Controlled access:
- Choose who can access this app:
- Allow everyone in your organization to access: All Okta users (use constraints in Wiretastix to limit)
- Limit access to selected groups: Select specific groups (recommended)
- Skip group assignment for now: Assign later
- Choose who can access this app:
Click Save
Step 4: Retrieve Client Credentials
After creating the application, you’ll see the application settings:
- Client ID: Copy this value - you’ll need it for Wiretastix configuration
- Client secret: Copy this value immediately - you may need to reveal it by clicking Show
- Note the Okta domain from your browser URL (e.g.,
dev-12345.okta.com)
Step 5: Configure Token Claims (Groups)
Okta needs to include group information in tokens:
Add Group Claims to Tokens
- In your application settings, scroll down to Group Claims
- Click Edit next to OpenID Connect ID Token
- Configure group claims:
- Filter: Choose based on your needs:
- Matches regex:
.*(includes all groups) - Starts with:
VPN-(only groups starting with VPN-) - Equals: (specify exact group names)
- Matches regex:
- Value: Choose
Name(easier to use) orOkta Group ID(more secure)
- Filter: Choose based on your needs:
- Click Save
Recommendation: Use “Starts with” filter with a prefix like VPN- to only include relevant groups and avoid token size issues.
Step 6: Create Groups in Okta
To leverage group-based access control:
Navigate to Directory → Groups in the Admin Console
Click Add Group
Fill in the group details:
- Name:
VPN-Users(use the prefix that matches your filter from Step 5) - Group Description:
Users with VPN access
- Name:
Click Save
Repeat for additional groups:
VPN-AdminsVPN-DevelopersVPN-Contractors
Assign Users to Groups
- Click on a group
- Go to the People tab
- Click Assign people
- Search for and select users
- Click Save
Step 7: Assign Groups to Application
To control which groups can access Wiretastix:
- Navigate to Applications → Applications
- Click on your Wiretastix VPN application
- Go to the Assignments tab
- Click Assign → Assign to Groups
- Select the groups that should have access (e.g.,
VPN-Users,VPN-Admins) - Click Assign for each group
- Click Done
Note: Users must be assigned to the application (directly or via group) to authenticate.
Step 8: Configure Authorization Server (Optional)
For more control over tokens, configure the default authorization server:
- Navigate to Security → API in the Admin Console
- Select your authorization server (typically
default) - Go to the Claims tab
- Verify that group claims are configured:
- Name:
groups - Include in token type: ID Token, Always
- Value type: Groups
- Filter: Matches your configuration from Step 5
- Name:
Step 9: Retrieve Okta Configuration Details
You’ll need the following information:
Okta Domain: Your organization’s domain (e.g.,
dev-12345.okta.com)Client ID: From Step 4
Client Secret: From Step 4
Issuer URL: Constructed as:
https://{okta-domain}/oauth2/default/.well-known/openid-configurationOr if using a custom authorization server:
https://{okta-domain}/oauth2/{authServerId}/.well-known/openid-configurationFor example:
https://dev-12345.okta.com/oauth2/default/.well-known/openid-configuration
Step 10: Configure Wiretastix
Edit your /etc/wiretastix/wiretastix.yaml file:
oidc:
name: Okta
client-id: YOUR_OKTA_CLIENT_ID
client-secret: YOUR_OKTA_CLIENT_SECRET
redirect-url: https://vpn.example.com/callback
config-issuer: https://dev-12345.okta.com/oauth2/default/.well-known/openid-configuration
cookie-secret: GENERATE_A_RANDOM_STRING_HERE
force-approval: false
verbose: false
refresh-min-interval-sec: 300
scopes:
- openid
- email
- profile
- offline_access
- groups
constraints:
groups:
- VPN-Users
- VPN-Admins
Configuration Parameters Explained
name: A friendly name for the provider (displayed in logs)client-id: The Client ID from Step 4client-secret: The Client Secret from Step 4redirect-url: Must match exactly what you configured in Oktaconfig-issuer: Okta’s OpenID Connect discovery URLcookie-secret: A random string for session encryption (generate with:openssl rand -base64 32)force-approval: Set totrueto force consent screen on every loginverbose: Enable detailed OIDC logging for troubleshootingrefresh-min-interval-sec: Minimum seconds between token refresh attemptsscopes: Required OAuth scopes (note thegroupsscope)constraints: Access control rules
Understanding Okta Scopes
Okta requires the groups scope to include group claims in tokens:
scopes:
- openid
- email
- profile
- offline_access # For refresh tokens
- groups # For group claims (required!)
Without the groups scope, group information won’t be included in tokens.
Understanding Constraints with Okta
Okta provides excellent group support:
Group Constraints (Recommended)
Control access based on Okta group membership:
constraints:
groups:
- VPN-Users
- VPN-Developers
Users must be a member of at least one of these groups to authenticate.
Important: The group names in constraints must match:
- The actual group names in Okta (case-sensitive)
- What’s returned in the groups claim (based on your Value setting in Step 5)
Email Constraints
You can also restrict by email:
constraints:
email:
- alice@example.com
- bob@example.com
groups:
- VPN-Users
With both constraints, users must satisfy all constraint types.
Step 11: Generate a Cookie Secret
Generate a secure random string:
openssl rand -base64 32
Copy the output and paste it into the cookie-secret field.
Step 12: Restart Wiretastix
Restart the Wiretastix daemon:
sudo systemctl restart wiretastix
Or if running manually:
sudo wiretastix-daemon -c /etc/wiretastix/wiretastix.yaml
Step 13: Test the Integration
- Open your web browser and navigate to
https://vpn.example.com - You should be redirected to Okta’s sign-in page
- Sign in with an Okta account that is:
- Assigned to the Wiretastix application (directly or via group)
- A member of one of the allowed groups
- If this is the first time, you may see a consent screen - click Allow
- You should be redirected back to Wiretastix and logged in
If successful, you’ll see the Wiretastix dashboard.
Troubleshooting
Error: “redirect_uri_mismatch” or Invalid Redirect URI
Cause: The redirect URL doesn’t match what’s configured in Okta.
Solution:
- Go to Okta Admin Console → Applications → Your app
- Check Sign-in redirect URIs
- Ensure it exactly matches
redirect-urlinwiretastix.yaml - Protocol (https), domain, and path (/callback) must match exactly
- Click Save
Error: “invalid_client” or Client Authentication Failed
Cause: Incorrect client ID or client secret.
Solutions:
- Verify the Client ID in Okta matches
client-idin Wiretastix - Regenerate the client secret in Okta if needed:
- Go to application settings → Client Credentials
- Click Edit → Generate new secret
- Update Wiretastix configuration with new secret
Error: “User is not assigned to the client application”
Cause: User not assigned to the Wiretastix application in Okta.
Solutions:
- Go to Applications → Wiretastix VPN → Assignments
- Assign the user directly or via a group
- Ensure the user’s group is assigned to the application
Groups Not Appearing in Token
Cause: Group claims not configured or groups scope missing.
Solutions:
- Verify
groupsscope is in Wiretastix configuration - Check group claims configuration in Okta (Step 5)
- Ensure group filter matches your group names
- Verify users are actually members of groups
- Enable
verbose: truein Wiretastix and check received claims
“User Not Authorized” Despite Being in Group
Cause: Group name mismatch or group not in token.
Solutions:
- Verify group names in Wiretastix constraints match Okta group names exactly (case-sensitive)
- Check if group filter in Okta includes the groups
- Review token contents (use Okta’s token preview or verbose logging)
- Ensure user is actually assigned to the application
Token Refresh Failures
Cause: Refresh token configuration issues.
Solutions:
- Ensure
offline_accessscope is in Wiretastix config - Check token lifetime settings in Okta:
- Security → API → Authorization server → Access Policies
- Verify refresh token rotation is configured appropriately
“Invalid Issuer” Error
Cause: Incorrect issuer URL or authorization server.
Solutions:
- Verify your Okta domain is correct
- Ensure format:
https://{okta-domain}/oauth2/default/.well-known/openid-configuration - If using custom authorization server, replace
defaultwith your server ID - Check Okta is accessible from Wiretastix server
Enable Verbose Logging
In Wiretastix:
oidc:
verbose: true
In Okta:
- Navigate to Reports → System Log in the Admin Console
- Filter by:
- Event Type: User authentication
- Target: Your application name
- Review authentication events for errors
Token Preview in Okta
To see what claims are in tokens:
- In Okta Admin Console, go to Applications → Your app
- Click Sign On tab
- Scroll to OpenID Connect ID Token
- Click Preview token
- Sign in as a test user
- Review token contents, especially the
groupsclaim
Advanced Okta Configuration
Dynamic Groups
Automatically manage group membership:
- Navigate to Directory → Groups
- Click Add Group
- Choose Dynamic
- Define rules based on user attributes (e.g.,
user.department == "Engineering") - Users are automatically added/removed based on attribute changes
Wiretastix defers authentication policy entirely to the IdP – if you want MFA, Okta ThreatInsight anomaly detection, or a custom authorization server enforced before a user ever reaches Wiretastix, configure it on the Okta side (Security → Multifactor/Authentication Policies/ThreatInsight/API) as you would for any other app; none of it is Wiretastix-specific, and Wiretastix has no visibility into or control over it.
Okta and Wiretastix Group Synchronization
Wiretastix automatically synchronizes group memberships:
- On First Login: User’s groups are imported from Okta
- On Token Refresh: Groups are updated based on current Okta membership
- Group Changes Take Effect on the Next Refresh, Not Just at Login: If the reissued token includes a non-empty
groupsclaim, Wiretastix re-syncs group membership and rebuilds firewall rules on the next successful token refresh – not only at the user’s next full login. If a user no longer matches any real Wiretastix group, they fall back to whateverdefault_groupis configured to. If that fallback group has a restrictivepolicy(e.g.drop) or its own restrictive rules, the user’s actual network access is cut off on that same refresh cycle – even though their Wiretastix user account stays enabled the whole time. This is a different thing fromauto_disable_on_auth_error, which disables the account itself and only fires when the refresh call fails outright (e.g. the IdP revoked the token), not from a group change alone. The one thing that genuinely is login-gated rather than refresh-gated isconstraints(the allow/deny rule for who may authenticate at all): that’s only re-checked at the user’s next full login.
Security Best Practices
- Use HTTPS: Always use HTTPS for Wiretastix
- Strong Secrets: Generate strong client secrets and cookie secrets
- Secret Rotation: Regularly rotate client secrets
- Token Expiration: Configure appropriate token lifetimes
- MFA: Require multi-factor authentication for VPN access
- Least Privilege: Only grant necessary group memberships
- Authentication Policies: Use Okta policies to enforce security requirements
- Audit Logs: Regularly review Okta system logs
- Monitor: Set up alerts for suspicious authentication attempts
- Rate Limiting: Configure rate limits in Okta to prevent brute force attacks
Next Steps
After successfully configuring Okta OIDC:
- Manage Users - Manage users in Wiretastix
- Manage Groups - Configure group policies
- Configure Network Rules - Set up group-based firewall rules
- Managing Peers - Understand peer management
- Default Configuration Settings - Fine-tune defaults