Target Is Undefined Error With Okta-Hosted Sign-In Widget After OIE Upgrade
Last Updated:
Overview
An error occurs when code uses OktaUtil.getRequestContext().target.clientId with the Okta-hosted Sign-in Widget after an upgrade to Okta Identity Engine (OIE). Replacing the function with the updated code resolves the issue. Okta returns the following error when the code references the removed target property.
target is undefined
Applies To
- Okta Identity Engine (OIE)
- Sign-in Widget
Cause
After an upgrade to OIE, the getRequestContext() object changes. The target property is no longer available in this object, so code that references OktaUtil.getRequestContext().target.clientId fails.
Solution
How is the Sign-in Widget code updated after the OIE upgrade?
Replace OktaUtil.getRequestContext().target.clientId with the updated function mentioned below to restore the Sign-in Widget code.
OktaUtil.getRequestContext.app.value.id
