<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content

Target Is Undefined Error With Okta-Hosted Sign-In Widget After OIE Upgrade

Administration
Okta Identity Engine

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

 

Related References

Loading
Okta Support - Target Is Undefined Error With Okta-Hosted Sign-In Widget After OIE Upgrade