Utilize the built-in method of Okta SignIn Widget to enable or disable the username field

@andrea @abole

My organization uses an Okta-SignIn Widget Log-in page for one of our applications like below -

const widget = new OktaSignIn({ ...options })

Let’s imagine I want to disbale the username field, so can I use the below code to disable the username field ?

widget.router['controller'].state.set('disableUsername', false) // this works

I’ve looked through the core code of the OktaSignInWidget , it uses the same technique to disable and enable the username field -

this.state.set('disableUsername', false); // to enable, pass true

Although we can achieve the same purpose with vanilla JS, is using Okta’s technique a better way to go about it?

Please do share your thoughts here.


Hi @tushky sorry this isn’t an area I’m particularly familiar with. To hazard an uninformed guess, I would imagine either are OK as long as the widget state store maintains the value.

1 Like

@tech_okta @oktadev-blog Your thoughts on above query?