Configure Okta as the SCIM identity provider
This topic describes how to configure Okta as the SCIM identity provider for HCP Terraform. After completing this configuration, HCP Terraform can accept SCIM provisioning requests from Okta for users and groups.
Background
Okta provisions users and groups to HCP Terraform using the SCIM protocol. Okta acts as the source of truth for user identities and group membership. When you assign a user or group to your custom HCP Terraform application in Okta, Okta pushes those changes to HCP Terraform automatically.
HCP Terraform matches incoming SCIM users to existing accounts by email address. When a match is found, the existing account becomes SCIM-managed. When no match is found, HCP Terraform creates a new organization-owned account. Okta group names become team names in HCP Terraform directly. There is no separate name mapping.
You cannot use the Terraform Cloud application from the Okta Integration Network gallery for SCIM. You must create a custom application to complete this configuration.
To configure Okta as the SCIM identity provider for HCP Terraform:
- Create a custom application in Okta and configure SAML SSO on it.
- Configure the API integration and configure the SCIM base URL and token.
- Configure provisioning actions.
- Start provisioning.
- Configure group push and verify the setup.
Requirements
Before you configure Okta as the SCIM identity provider, enable SCIM in HCP Terraform and generate a SCIM token. You must also create a custom SAML application in Okta and have administrator permissions to configure SCIM provisioning. Refer to Configure SCIM provisioning for instructions.
Before broad rollout, validate your Okta user identifier and attribute mappings with a small set of test users.
Create a custom application
You must create a custom SAML application. You cannot use the existing Terraform Cloud application from the Okta Integration Network gallery.
- From the Okta Admin Dashboard, navigate to Applications > Applications.
- Click Create App Integration.
- Select SAML 2.0.
- Name the app and click Next.
- Under Configure SAML, set the following values. The Single sign-on URL and Audience URI are temporary and will be replaced in a later step:
- Single sign-on URL:
https://app.terraform.io/sso/saml/placeholder - Audience URI (SP Entity ID):
placeholder - Name ID format:
EmailAddress - Application username:
Okta username - Update application username on:
Create and update
- Single sign-on URL:
- Under Feedback, select This is an internal app that we have created.
- Click Finish.
- Copy the Metadata URL to use in the HCP Terraform configuration.
- Configure SAML SSO in HCP Terraform for this new custom application by providing the Metadata URL you copied in the previous step. Follow the instructions in Use single sign-on with Okta for HCP Terraform, up to and including the step to click Enable.
- In the Okta application, update the following with the values from the HCP Terraform SSO configuration:
- Single sign-on URL: use the Assertion Consumer URL from HCP Terraform
- Audience URI (SP Entity ID): use the Entity ID (Audience) from HCP Terraform
- Verify the SSO configuration by clicking Test. If the test is successful, click Enable.
Configure API integration
After SCIM is enabled, configure the SCIM connection in Okta.
- Sign in to the Okta Admin Console.
- Navigate to Applications and open your custom HCP Terraform application.
- On the General tab under App Settings, click Edit and select SCIM as Provisioning. After saving, a new Provisioning tab appears.
- Click the Provisioning tab.
- Click Edit for the SCIM Connection and complete the following fields:
- SCIM connector base URL: Enter the base URL you copied from HCP Terraform. Refer to Enable SCIM for more information.
- Unique identifier field for users: Set to
email. - Supported provisioning actions: Enable Push New Users, Push Profile Updates, and Push Groups.
- Authentication Mode: Select HTTP Header.
- Authorization: Enter the SCIM token you copied from HCP Terraform. Refer to Enable SCIM for more information.
- Click Test Connector Configuration to verify the configuration.
- Click Save.
Configure provisioning actions
After the API integration is verified, new settings appear under the Provisioning tab.
- On the Provisioning tab, click To App in the left sidebar.
- Click Edit.
- Enable the following options:
- Create Users: Allows Okta to create new users in HCP Terraform.
- Update User Attributes: Allows Okta to update user attributes in HCP Terraform.
- Deactivate Users: Allows Okta to deactivate users in HCP Terraform when they are unassigned or suspended in Okta.
- Click Save.
Configure group push
Complete the following steps to synchronize Okta groups:
- Click the Push Groups tab.
- Click Push Groups and select Find groups by name or Find groups by rule.
- Search for and select the groups you want to push to HCP Terraform.
- Click Save.
Okta creates corresponding teams in HCP Terraform for each pushed group. Okta group names become team names in HCP Terraform directly. When assigning groups, note the following factors:
- IdP group names become team names in HCP Terraform directly. There is no separate name mapping step.
- Group names must be fewer than 90 characters.
- Nested group membership is not supported.
- HCP Terraform supports a maximum of 3,000 IdP groups and 1,000 members per group.
Refer to Group lifecycle for more information about groups.
Before enabling SCIM, review existing team memberships. When an Okta group name matches an existing HCP Terraform team name, SCIM takes over that team and replaces its membership with the Okta group membership.
We recommend using separate groups for SSO access, which controls who can sign in, and SCIM team membership, which controls team assignments within HCP Terraform.
Start provisioning
Start with a small rollout to verify provisioning before broader adoption:
- Click the Assignments tab in your HCP Terraform application.
- Click Assign and select either Assign to People or Assign to Groups.
- Select a test user or group to provision.
- Click Assign for each selection, then click Done.
Initial provisioning may take longer than later updates, especially when provisioning many users or groups. Later provisioning runs only process subsequent changes.
When you assign users or groups:
- Users: Okta immediately provisions assigned users. Users can log in using SAML SSO after provisioning.
- Groups: If you configured group push, Okta creates the groups. Group membership is synchronized automatically.
When HCP Terraform receives a SCIM user deactivation request, it removes the user's access to HCP Terraform.
Refer to User lifecycle for more information.
Attribute mappings
The following tables show the Okta-to-SCIM mappings. The Required column reflects what HCP Terraform requires on incoming SCIM requests.
Users
| Okta attribute | SCIM attribute | Required |
|---|---|---|
userName | userName | Yes |
emails | emails | Yes |
HCP Terraform requires userName and at least one email value for each user. Set the Unique identifier field for users to email. During user creation, HCP Terraform links existing users by email address when the email matches.
Groups
| Okta attribute | SCIM attribute | Required |
|---|---|---|
displayName | displayName | Yes |
members | members | No |
externalId | externalId | No |
Test provisioning
After completing the configuration, verify that provisioning works correctly.
Verify user provisioning
- Assign a test user to the HCP Terraform application in Okta.
- Wait a few moments for Okta to provision the user.
- Navigate to your organization in HCP Terraform.
- Verify that the test user appears with a status of Synced.
- Test that the user can log in using SSO.
Verify group provisioning
- Push a test group from Okta.
- Navigate to Teams in your HCP Terraform organization settings.
- Verify that the group appears as a team.
- Confirm team membership reflects the Okta group membership.
Verify user deactivation
- Unassign a test user from the application in Okta.
- Wait a few moments for Okta to deactivate the user.
- Log in to HCP Terraform and verify that the user is deactivated.
Troubleshooting
If you encounter issues with Okta SCIM provisioning, use the following guidance to diagnose and resolve common problems.
Authentication failures
| Issue | Cause | Solution |
|---|---|---|
401 Unauthorized error | Invalid or expired SCIM token | Create a new SCIM token and update the Okta configuration. |
| Test API Credentials fails | Incorrect base URL or token | Verify the SCIM base URL format and ensure the token value is correct. |
| Connection timeout | Network or firewall issues | Verify that Okta can reach your HCP Terraform. Check firewall rules and network connectivity. |
User provisioning failures
| Issue | Cause | Solution |
|---|---|---|
| Users not created | Incorrect user identifier or attribute mapping | Review the Okta user identifier and attribute mappings, then test with a single user before broad rollout. |
| Duplicate user errors | Existing user or SCIM identity conflicts with the incoming Okta user | If the email matches an existing user, HCP Terraform links that user to SCIM. |
| User attributes not updating | Update User Attributes not enabled | Enable Update User Attributes in the Okta provisioning settings. |
Group provisioning failures
| Issue | Cause | Solution |
|---|---|---|
| Groups not appearing | Push Groups not configured | Configure group push in Okta and select the groups to push. |
| Group membership not syncing | Users are not provisioned in HCP Terraform | Confirm that group members have been assigned to the application in Okta. |
| Large group operations timeout | Group exceeds size limits | Split large groups into smaller groups. The maximum is 1,000 members per group. |
Rate limiting
Okta may encounter rate limits when provisioning large numbers of users or groups. If you see 429 Too Many Requests errors, it's because HCP Terraform temporarily rate-limits SCIM requests when request volume is too high. Review the Okta provisioning logs, wait for provisioning to continue, and refer to Troubleshoot SCIM provisioning if the condition persists.
View provisioning logs in Okta
To view detailed provisioning logs and error messages:
- In the Okta Admin Console, navigate to your HCP Terraform application.
- Click the Provisioning tab.
- Click View Logs to see recent provisioning events.
- Filter by status to find failed operations.
For additional troubleshooting guidance, refer to Troubleshoot SCIM provisioning.
Next steps
Review the following topics for more information about managing users and groups:
- User lifecycle describes how SCIM-managed users work in HCP Terraform.
- SCIM group management describes how SCIM groups integrate with HCP Terraform teams.