# Disable username field when login\_hint is provided in Okta Sign-In Widget

**URL:** <https://devforum.okta.com/t/disable-username-field-when-login-hint-is-provided-in-okta-sign-in-widget/34922>\
**Category:** OAuth/OIDC\
**Tags:** widget\
**Created:** [January 21, 2026, 9:25am UTC](https://devforum.okta.com/t/disable-username-field-when-login-hint-is-provided-in-okta-sign-in-widget/34922 "2026-01-21T09:25:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![selvakumarkec](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@selvakumarkec](https://devforum.okta.com/u/selvakumarkec)\
**Post date:** [January 21, 2026, 9:25am UTC](https://devforum.okta.com/t/disable-username-field-when-login-hint-is-provided-in-okta-sign-in-widget/34922/1 "2026-01-21T09:25:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 3, 2026, 10:55pm UTC](https://devforum.okta.com/t/disable-username-field-when-login-hint-is-provided-in-okta-sign-in-widget/34922/2 "2026-02-03T22:55:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [March 5, 2026, 10:56pm UTC](https://devforum.okta.com/t/disable-username-field-when-login-hint-is-provided-in-okta-sign-in-widget/34922/3 "2026-03-05T22:56:29Z")

</div>

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