- What is SCIM?
- Prerequisites
- Understanding the Okta Limitation
- Setup Overview
- Step-by-Step Configuration
- Testing Your Setup
- Debugging SCIM Issues
- Common Issues & Solutions
- How User Removal Works
- Resources
SCIM (System for Cross-domain Identity Management) lets Okta automatically create, update, and remove users in Coder - so you don't have to manage them manually.
What SCIM does:
- Creates Coder users when assigned in Okta
- Updates user information when changed in Okta
- Suspends Coder users when unassigned in Okta
- Can sync group memberships (if configured)
- Enterprise Coder license (SCIM is enterprise-only)
- Admin access to both Okta and Coder
- Coder deployment accessible from Okta (public URL or proper network access)
Note: You do NOT need OIDC working first, but it's recommended to set up authentication before provisioning.
CRITICAL: Okta does NOT support adding SCIM provisioning to OIDC apps through the UI.
This is a known limitation. The Okta documentation states:
"Adding SCIM provisioning to an OpenID Connect (OIDC) integration isn't currently supported."
The Solution: You must create TWO separate apps in Okta:
- OIDC app - Handles user authentication (login)
- SAML app with SCIM - Handles user provisioning (lifecycle management)
Users will be assigned to both apps, but will only interact with the OIDC app for login.
Here's the architecture:
┌─────────────────────────────────────────────────┐
│ Okta │
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ OIDC App │ │ SAML App │ │
│ │ (Authentication)│ │ (SCIM Only) │ │
│ │ │ │ │ │
│ │ Users: Group A │ │ Users: Group A │ │
│ └────────┬─────────┘ └────────┬─────────┘ │
│ │ │ │
└───────────┼─────────────────────┼──────────────┘
│ │
│ Auth requests │ SCIM requests
│ │
▼ ▼
┌───────────────────────────────────────────────┐
│ Coder Server │
│ │
│ /api/v2/users/oidc/callback /scim/v2 │
└───────────────────────────────────────────────┘
-
Set the SCIM API key in your Coder deployment:
CODER_SCIM_AUTH_HEADER="your-secret-token-here"Generate a secure random token (e.g.,
openssl rand -hex 32) -
Restart your Coder server
-
Verify SCIM endpoint is accessible:
curl -H "Authorization: Bearer your-secret-token-here" \ https://your-coder-domain.com/scim/v2/ServiceProviderConfigShould return JSON with SCIM capabilities (not 401/404)
Skip to Part 3 - keep your existing OIDC app as-is.
-
Okta Admin Console → Applications → Applications
-
Click Create App Integration
-
Select OIDC - OpenID Connect → Web Application → Next
-
Configure General Settings:
- App integration name:
Coder(or your preference) - Logo: (optional)
- Grant type:
- ✅ Authorization Code
- ✅ Refresh Token (recommended)
- Sign-in redirect URIs:
https://your-coder-domain.com/api/v2/users/oidc/callback - Sign-out redirect URIs:
https://your-coder-domain.com/(optional) - Controlled access: Choose who can access
- Click Save
- App integration name:
-
Copy Client Credentials:
- Client ID
- Client Secret
-
Configure Group Claims (Optional but Recommended):
- Go to Sign On tab
- Under OpenID Connect ID Token, click Edit
- Groups claim type: Filter
- Groups claim filter:
groupsMatches regex.* - Click Save
-
Configure Coder with OIDC settings:
CODER_OIDC_ISSUER_URL="https://your-okta-domain.okta.com" CODER_OIDC_CLIENT_ID="your-client-id" CODER_OIDC_CLIENT_SECRET="your-client-secret" CODER_OIDC_EMAIL_DOMAIN="your-company.com" CODER_OIDC_SCOPES="openid,profile,email,groups" # Optional: Group sync CODER_OIDC_GROUP_FIELD="groups"
-
Restart Coder and test OIDC login
Now create a separate app for SCIM provisioning:
-
Okta Admin Console → Applications → Applications
-
Click Create App Integration
-
Select SAML 2.0 → Next
-
General Settings:
- App name:
Coder SCIM Provisioning - App logo: (optional, can use same as OIDC app)
- Click Next
- App name:
-
SAML Settings (these are dummy values - we won't use SAML):
- Single sign-on URL:
https://your-coder-domain.com/fake - Audience URI (SP Entity ID):
https://your-coder-domain.com - Click Next
- Single sign-on URL:
-
Feedback:
- Select: "I'm an Okta customer adding an internal app"
- "This is an internal app that we have created"
- Click Finish
-
Go to the Coder SCIM Provisioning app you just created
-
Click General tab
-
In App Settings section → Click Edit
-
Provisioning: Change dropdown from "None" to SCIM
-
Click Save
The Provisioning tab should now appear
-
Click Provisioning tab
-
Under Settings → Integration → Click Edit
-
Configure SCIM Settings:
- SCIM connector base URL:
https://your-coder-domain.com/scim/v2 - Unique identifier field for users:
userName - Supported provisioning actions:
- ✅ Push New Users
- ✅ Push Profile Updates
- Authentication Mode: HTTP Header
- Authorization: (paste the exact value below)
Bearer your-coder-scim-api-key-here⚠️ Important: Include the word "Bearer" with a space, then your key
- SCIM connector base URL:
-
Click Test Connector Configuration
- Should show "Coder SCIM Provisioning was verified successfully"
- If it fails, check the Debugging section
-
Click Save
-
Still in Provisioning tab
-
Click Settings → To App → Click Edit
-
Enable these features:
- ✅ Create Users: Creates users in Coder when assigned
- ✅ Update User Attributes: Syncs profile changes
- ✅ Deactivate Users: Suspends users when unassigned
-
Click Save
Critical Step: Assign the same users/groups to BOTH apps.
-
Create an Okta Group:
- Directory → Groups → Add Group
- Name:
Coder Users - Add members
-
Assign Group to OIDC App:
- Go to your Coder OIDC app
- Assignments tab → Assign → Assign to Groups
- Select
Coder Users→ Assign → Done
-
Assign Group to SCIM App:
- Go to your Coder SCIM Provisioning app
- Assignments tab → Assign → Assign to Groups
- Select
Coder Users→ Assign → Done
If not using groups:
- Assign individual users to both apps
- Ensure the same users are in both apps
- Assign a test user to the SCIM app in Okta
- Check Coder UI → Users page
- User should appear automatically within seconds
- Status will be "Dormant" (until first login)
- Open Coder in incognito/private window
- Click Login with OIDC (or your SSO button)
- Should redirect to Okta
- After authentication, should return to Coder
- User status changes from "Dormant" to "Active"
- Unassign the test user from the SCIM app in Okta
- Check Coder UI → User should be marked as "Suspended"
- User cannot log in anymore
# Enable SCIM-specific logging
CODER_LOG_FILTER=".*scim.*"
# Or enable all debug logs
CODER_LOG_FILTER=".*"Look for SCIM operations tagged with:
{
"automatic_actor": "coder",
"automatic_subsystem": "scim"
}# If running in Kubernetes
kubectl logs deployment/coder -n coder --follow
# If running as systemd service
journalctl -u coder --follow
# Look for SCIM requests
grep "scim" /var/log/coder.log# Test endpoint accessibility
curl -v -H "Authorization: Bearer YOUR_SCIM_API_KEY" \
https://your-coder-domain.com/scim/v2/ServiceProviderConfigExpected response:
- Status: 200 OK
- Content-Type: application/scim+json
- Body: JSON with SCIM capabilities
Common failures:
- 401 Unauthorized: Wrong API key or missing "Bearer" prefix
- 404 Not Found: Wrong URL or SCIM not enabled
- Connection refused: Network/firewall issue
- Okta Admin Console → Reports → System Log
- Filter by:
- Application: Your SCIM app
- Event Type:
app.provision.*
- Look for:
- Success events:
app.provision.user.push - Error events: Red icons with error messages
- Success events:
# Test user creation
curl -X POST \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/scim+json" \
-d '{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "testuser",
"emails": [{"primary": true, "value": "[email protected]", "type": "work"}],
"name": {"givenName": "Test", "familyName": "User"},
"active": true
}' \
https://your-coder.com/scim/v2/Users
# Test user deactivation (replace USER_UUID)
curl -X PATCH \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/scim+json" \
-d '{"active": false}' \
https://your-coder.com/scim/v2/Users/USER_UUIDSymptoms:
- "Unable to verify credentials" error in Okta
- 401 Unauthorized response
Solutions:
-
Verify Bearer token format:
- Must be:
Bearer your-key-here(with space) - Not:
your-key-hereorBearer: your-key-here
- Must be:
-
Check API key matches:
# On Coder server echo $CODER_SCIM_AUTH_HEADER
-
Test endpoint directly:
curl -H "Authorization: Bearer $CODER_SCIM_AUTH_HEADER" \ https://your-coder.com/scim/v2/ServiceProviderConfig -
Check Coder logs for authentication errors
Symptoms:
- User assigned in Okta but doesn't appear in Coder
- No SCIM requests in Coder logs
Solutions:
-
Verify "Create Users" is enabled:
- SCIM app → Provisioning → To App
- "Create Users" should be checked
-
Check user is assigned to SCIM app:
- SCIM app → Assignments tab
- User should be listed
-
Check Okta System Logs:
- Look for provisioning errors
- Filter by user and SCIM app
-
Verify email domain:
- Coder may reject users with wrong email domain
- Check
CODER_OIDC_EMAIL_DOMAINsetting
Symptoms:
- User unassigned from Okta but still active in Coder
- No deactivation request in logs
Solutions:
-
Verify "Deactivate Users" is enabled:
- SCIM app → Provisioning → To App → Edit
- "Deactivate Users" should be checked
-
Understand Okta behavior:
- Okta sends PATCH request with
active: false - Okta does NOT send DELETE requests
- User becomes "suspended" in Coder (not deleted)
- Okta sends PATCH request with
-
Check Okta System Logs:
- Look for
app.provision.user.deprovisionevents - Check for errors
- Look for
-
Verify initial provisioning succeeded:
- If user creation failed, deactivation won't work
- Check Okta's view of user status
Symptoms:
- User can authenticate via OIDC
- But gets "User not found" error
Solutions:
-
User is in OIDC app but not SCIM app:
- Assign user to SCIM app for provisioning
- Or enable JIT (Just-In-Time) provisioning in Coder
-
User emails don't match:
- OIDC email must match SCIM email
- Check user profile in both systems
Symptoms:
- Can't find "Deactivate Users" checkbox in Okta
Solutions:
-
Make sure you enabled SCIM first:
- General tab → Edit → Provisioning: SCIM
-
Check Provisioning tab exists:
- If no Provisioning tab, SCIM wasn't enabled properly
-
Contact Okta support:
- Feature may need to be enabled for your org
Symptoms:
- 401 errors in Coder logs
- "Invalid authorization" responses
Solutions:
-
Check Bearer token has no extra spaces:
# Wrong "Bearer your-key" # Two spaces "Bearer your-key " # Trailing space # Correct "Bearer your-key"
-
Verify API key is set in Coder:
# Should output your key printenv | grep CODER_SCIM_AUTH_HEADER
-
Restart Coder after changing env vars
- Okta does NOT send DELETE requests to SCIM endpoints
- Instead, it sends:
PATCH /Users/{id}with{"active": false} - This happens immediately when user is unassigned
- Receives SCIM PATCH request with
active: false - Updates user status synchronously:
active: true→ User becomes "Dormant" (if not logged in) or stays "Active"active: false→ User becomes "Suspended"
- Suspended users:
- Cannot log in
- Cannot access workspaces
- Don't count toward license seats
- Can be reactivated by setting
active: true
- No built-in delay in Coder
- Processing is synchronous (happens immediately)
- Typical response time: < 1 second
- If there's a delay, it's from:
- Okta processing time
- Network latency
- Coder server load
# Watch Coder logs during deprovisioning
tail -f /var/log/coder.log | grep scim
# You should see:
# - PATCH request received
# - User status updated
# - Response sent| Okta State | SCIM Request | Coder Status |
|---|---|---|
| Assigned (never logged in) | active: true |
Dormant |
| Assigned (logged in) | active: true |
Active |
| Unassigned | active: false |
Suspended |
- Authentication (OIDC): Who you are, handled by OIDC app
- Provisioning (SCIM): Do you exist, handled by SCIM app
- Both are required for a complete user lifecycle
-
Keep SCIM API key secure
- Treat like a database password
- Rotate periodically
- Store in secrets management (e.g., Kubernetes secrets)
-
Use HTTPS only
- Never configure HTTP SCIM endpoints
- Validate SSL certificates
-
Monitor SCIM audit logs
- Track all provisioning activities
- Set up alerts for failures
-
Limit network access
- Whitelist Okta IPs if possible
- Use firewall rules
Coder implements these SCIM 2.0 endpoints:
| Method | Endpoint | Purpose | Coder Behavior |
|---|---|---|---|
| GET | /scim/v2/ServiceProviderConfig |
Service capabilities | Returns supported features |
| GET | /scim/v2/Users |
List users | Always returns empty (forces Okta to create) |
| GET | /scim/v2/Users/{id} |
Get user by ID | Always returns 404 (forces Okta to create) |
| POST | /scim/v2/Users |
Create user | Creates or returns existing user |
| PATCH | /scim/v2/Users/{id} |
Update user | Updates active status |
| PUT | /scim/v2/Users/{id} |
Replace user | Updates active status |
This is intentional design:
- Forces Okta to always attempt creation
- Simplifies implementation (no need to list/serialize users)
- POST endpoint handles "create or return existing"
# ============================================
# OIDC Configuration (Authentication)
# ============================================
CODER_OIDC_ISSUER_URL="https://your-okta-domain.okta.com"
CODER_OIDC_CLIENT_ID="0oa1abc2def3GHI456"
CODER_OIDC_CLIENT_SECRET="your-oidc-client-secret"
CODER_OIDC_EMAIL_DOMAIN="your-company.com,contractor-company.com"
CODER_OIDC_SCOPES="openid,profile,email,groups"
# Optional: Group sync from OIDC claims
CODER_OIDC_GROUP_FIELD="groups"
CODER_OIDC_GROUP_AUTO_CREATE="true"
# Optional: Ignore email verification
CODER_OIDC_IGNORE_EMAIL_VERIFIED="false"
# Optional: Custom username field
CODER_OIDC_USERNAME_FIELD="preferred_username"
# ============================================
# SCIM Configuration (Provisioning)
# ============================================
CODER_SCIM_AUTH_HEADER="your-secret-scim-token-here"
# ============================================
# Logging (for debugging)
# ============================================
# CODER_LOG_FILTER=".*scim.*" # SCIM only
# CODER_LOG_FILTER=".*" # All debug logsOIDC App:
- Name:
Coder - Type: OIDC - OpenID Connect, Web Application
- Redirect URI:
https://your-coder.com/api/v2/users/oidc/callback - Grants: Authorization Code, Refresh Token
- Scopes: openid, profile, email, groups
SCIM App:
- Name:
Coder SCIM Provisioning - Type: SAML 2.0 (but only using SCIM)
- SCIM Base URL:
https://your-coder.com/scim/v2 - Auth: Bearer token
- Features: Create Users, Update Attributes, Deactivate Users
✅ Two apps required: OIDC for auth, SAML with SCIM for provisioning
✅ Assign same users to both apps (use groups to simplify)
✅ Test thoroughly: Provisioning → Authentication → Deprovisioning
✅ Monitor logs: Both Okta System Logs and Coder server logs
✅ Security first: Treat SCIM API key as a secret, use HTTPS only
This setup provides complete user lifecycle management:
- Users created automatically when assigned
- Authentication via OIDC SSO
- Users suspended automatically when unassigned
- All changes logged for audit