Okta "Error 403 Forbidden" Occurs When Creating OAuth Web Application via API or Terraform
Last Updated:
Overview
Okta returns a 403 Forbidden error when administrators create an OpenID Connect (OIDC) web application via the API or Terraform because the organization has disabled the self-service assignment feature. Administrators can resolve this by enabling self-service application assignment in the Okta Admin Console or by setting the self-service parameter to false in the configuration. When administrators attempt to create an OIDC web application using the Okta API or Terraform, Okta generates the following errors:
Terraform Error
Error: failed to create OAuth application: the API returned an error: Self service application assignment is not enabled..
Causes: errorSummary: Self service application assignment for organization managed apps must be enabled.
API Error
{
"errorCode": "E0000043",
"errorSummary": "Self service application assignment is not enabled.",
"errorLink": "E0000043",
"errorId": "oaeLTJ3aTngQHCg3_4gY_HvDQ",
"errorCauses": [
{
"errorSummary": "Self service application assignment for organization managed apps must be enabled."
}
]
}Applies To
- Okta Identity Engine (OIE)
- Terraform Provider
- Okta API
- OIDC application
Cause
Okta generates the error when the application configuration includes the accessibility_self_service parameter when using Terraform (or accessibility.selfService in the Okta API) with its value set to true. Administrators must enable self-service assignment for organization-managed applications as a prerequisite for setting this property. If the organization disables this feature, Okta rejects the creation request with a 403 Forbidden status.
This issue is not specific to Terraform and occurs in any direct API integration attempting to enable self-service assignment for a new application.
Solution
How is the self-service assignment enabled in the Okta Admin Console?
Enable the self-service application assignment settings in the Okta Admin Console so users can add organization-managed applications.
-
Sign in to Admin Console.
-
Navigate to Applications > Self Service.
-
Select the Settings tab.
-
Click Edit.
-
Enable Allow users to add org-managed apps.
-
Click Save.
Modify Application Configuration
If the application does not require self-service assignment, update the request parameters in the Okta API or Terraform configuration to disable the feature.
For API Requests
Locate the accessibility object in the JSON payload and set selfService to false:
"accessibility": { "selfService": false, "errorRedirectUrl": null, "loginRedirectUrl": null }
For Terraform
-
Locate the
okta_app_oauthresource in the configuration file. -
Set the
accessibility_self_serviceparameter tofalse. -
Re-run the Terraform plan and apply.
