Okta Org2Org Federation Using OIDC Generates a Redirect URI Error
Last Updated:
Overview
An HTTP 400 error occurs during an Okta Org2Org connection configuration using OpenID Connect (OIDC) when a custom domain is used as the base URL. Resolve this error by updating the redirect domain settings in the OIDC Identity Provider (IdP) configuration to use a dynamic or custom URL. When the configuration uses a custom domain instead of the standard Okta domain, Okta generates the following error:
400 Bad Request - The redirect_uri Parameter Must Be a Login Redirect URI in the Client App Settings
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Org2Org
- OpenID Connect (OIDC) Identity Provider (IdP)
Cause
The error occurs because a custom domain is used as the base URL of the Org2Org application and is included in the endpoints specified in the OIDC IdP configuration. By default, the redirect domain is set to the standard Okta URL. If the redirect domain is not configured to dynamically match the request domain or the custom URL, the redirect URI validation fails.
Solution
What steps update the redirect domain in the Admin Console?
Update the redirect domain settings directly in the Admin Console to resolve the validation failure by navigating to the Identity Providers settings and modifying the redirect domain.
- Navigate to Security, and then select Identity Providers.
- Select the OIDC IdP configuration.
- Set the Redirect Domain to Dynamic (based on request domain) or Custom URL.
How is the redirect domain updated using the Okta API?
Use the Okta API to create or update the OIDC IdP when the redirect domain option is missing from the Admin Console.
- The following Okta API endpoint can be used to create a new OIDC IdP and specify the
issuerModeasDYNAMIC. - Alternatively, replace the existing OIDC IdP by adding the missing dynamic setting in the API request.
NOTE: Adding the missing property via the API resolves the error, but the Redirect Domain option remains hidden in the Admin Console.
