Disable username field when login_hint is provided in Okta Sign-In Widget

We are using the Okta Sign-In Widget with OIDC authentication.

The application passes login_hint to prepopulate the username on the login page.

Current behavior:

- login_hint correctly prepopulates the username

- Username field remains editable

Requirement:

- Username should be prefilled

- Username field should be non-editable / disabled

- Preferably achievable via Okta-supported configuration, policy, or feature flag

- Avoid frontend DOM manipulation or custom JavaScript where possible

Question 1 (Configuration support):

Is there any Okta-supported setting, policy, or feature flag

that disables the username field when login_hint is present?

Question 2 (Widget / event-based approach):

We understand that customers sometimes use the Sign-In Widget

event hooks (for example, on/afterRender) to disable the username field

programmatically once it is populated.

Can you confirm:

- Whether disabling the username field via widget lifecycle events

(such as afterRender) is a supported and recommended approach?

- Whether this approach is considered stable across widget upgrades?

I’m at least not aware or able to find a way within Okta to lock the username field in this scenario. In which case, your best option likely is to programmatically lock the field when a login_hint has been provided, which, as you mentioned, will probably involve using afterRender to prevent input on the field once its finished loading.

Because the field name/labels/id/data-se/etc may change (and are not documented in the widget readme as part of its specifications), I don’t see a way to ensure that the code you add will definitively work across all widget versions, but I would generally only expect needing to test when upgrading to a new major versions. That says, it will definitely be something you would want to test any time you upgrade the widget version in your application.

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