Hello @Lijia,
Thank you for the links. I have no problem with the Custom Sign In Page, it works as expected for me. My question relates to the Custom Error Page.
I cannot find any reference to OktaUtil
in the documentation for Custom Error Page: https://developer.okta.com/docs/guides/custom-error-pages/customization-examples/
When I embed {{{OktaUtil}}}
in the Custom Sign In Page, it is replaced with script, eg:
<body>
<!-- ...etc -->
{{{OktaUtil}}}
<script type="text/javascript">
var requestContext = OktaUtil.getRequestContext()
console.log(requestContext)
</script>
</body>
Renders as expected:
<body>
<!-- ...etc -->
<!-- {{{OktaUtil}}} string is replaced with -->
<div id="okta-sign-in" class="auth-container main-container unsupported-message-container" style="display:none">
<!-- ...etc -->
</div>
<script type="text/javascript">
// ... etc
OktaUtil.init();
</script>
<!-- my script... -->
</body>
And the output of my call to console is as expected
{ assets: { ... }, ... etc }
When I embed the same {{{OktaUtil}}}
string and script into the Custom Error Page it renders like this:
<body>
<!-- ...etc -->
<!-- {{{OktaUtil}}} string disappears and is not replace with the OktaUtil code -->
<!-- my script... -->
</body>
And my call to OktaUtil.getRequestContext()
fails because OktaUtil
is not defined.
So my question is: how can I access OktaUtil.getRequestContext()
(or an equivalent) from my script in the Custom Error Page?