How to consume PW Complexity Requirements object from Okta Widget?

Hi all

We are trying to embed the Sign-In Widget in a sort of landing page for new users to register.
We need real-time password validation exactly like this Okta Help Center (Lightning) but apparently V3 only works in Okta-hosted pages (source: Sign-In Widget (third generation) | Okta Identity Engine “The third generation doesn’t support self-hosting.”)

So, we are building our custom version, which requires to fetch something like this:

Complexity object sample

{
“minLength”: 8,
“minLowerCase”: 1,
“minUpperCase”: 1,
“minNumber”: 1,
“minSymbol”: 1,
“excludeUsername”: true,
“excludeAttributes”: [
“firstName”,
“lastName”
]
}

I took that sample from the idp/idx/enroll network request the widget does upon loading, and I would like to know if there’s a way to intercept this payload from the Widget and consume it?

I’d appreciate any guidance or best practices from anyone who has implemented something similar.

Anthony Leandro
Splunk/Cisco

Found it! We can use the idx API within the widget, like this:

const oktaSignIn = new OktaSignIn(config);
oktaSignIn.authClient.idx.introspect().then(response => {
console.log(response.rawIdxState.currentAuthenticator);
});

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.