# Using the Okta-hosted password page, how can I access the username

**URL:** <https://devforum.okta.com/t/using-the-okta-hosted-password-page-how-can-i-access-the-username/31363>\
**Category:** Questions\
**Tags:** widget\
**Created:** [December 2, 2024, 3:42pm UTC](https://devforum.okta.com/t/using-the-okta-hosted-password-page-how-can-i-access-the-username/31363 "2024-12-02T15:42:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![churr](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@churr](https://devforum.okta.com/u/churr)\
**Post date:** [December 2, 2024, 3:42pm UTC](https://devforum.okta.com/t/using-the-okta-hosted-password-page-how-can-i-access-the-username/31363/1 "2024-12-02T15:42:23Z")

</div>

Using the Okta-hosted password page, how can I access the username that was entered on the username page via the Okta SDK? . I know I can access the username by querying the DOM like this: let identifierText = document.querySelector(‘[data-se=“identifier”]’)?.title || ‘’, but I was hoping to use the Okta SDK instead, as querying the DOM is not reliable

---

<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:** [December 2, 2024, 5:55pm UTC](https://devforum.okta.com/t/using-the-okta-hosted-password-page-how-can-i-access-the-username/31363/2 "2024-12-02T17:55:49Z")

</div>

You could take a look at [transformUsername](https://github.com/okta/okta-signin-widget?tab=readme-ov-file#transformusername), since thats designed to pull out the username in case it needs to be modified before being sent to Okta. Thats the only built in function I’m aware of that would help with this use case

---

<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:** [January 1, 2025, 5:56pm UTC](https://devforum.okta.com/t/using-the-okta-hosted-password-page-how-can-i-access-the-username/31363/3 "2025-01-01T17:56:29Z")

</div>

Closed on January 1, 2025, 5:56pm UTC

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