WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Security / Quick Tip - Pre-filled credentials in the vSphere 6.0 Web Client

Quick Tip - Pre-filled credentials in the vSphere 6.0 Web Client

08.24.2015 by William Lam // 17 Comments

This past weekend I was finishing up a couple of demo recordings for my VMworld sessions in case the live demos fail for whatever reason, which has happened to me in the past. A few of the demos involve the vSphere Web Client UI and I thought instead of wasting time and potentially fat fingering credentials up on stage, I would try to do everything I can to remove any potential hiccups. In vSphere 6.0, the vCenter Single Sign-On page is now completely in HTML and this not only means you can customize the UI as I have shown here but you can also do some other neat tricks with it.

I decided to update the HTML page to automatically pre-fill both the SSO username and password, so that when I need to login to the vSphere Web Client, I just have to hit the tab key and then click on the login button.

prefilled-credentials
Disclaimer: Outside of a home lab or demo purposes, there is really no good reason for this. I can already hear Mike Foley sighing right now 😉 This also means that anyone who knows the address of your vSphere Web Client can just login, so you may want to only pre-fill the username and still type out the password in case you are concerned with that.

To pre-fill the value for the SSO username and/or password, you will need to edit the following file:

  • Windows VC: C:\ProgramData\VMware\vCenterServer\runtime\VMwareSTSService\webapps\websso\WEB-INF\views\unpentry.jsp
  • VCSA: /usr/lib/vmware-sso/vmware-sts/webapps/websso/WEB-INF/views/unpentry.jsp

For pre-filling the username, you will need to add a "value" property along with its actual value in the following section:

<input id="username" class="margeTextInput" type="text" value="*protected email*"/>

For pre-filling the password, you will need to add a "value" property along with its actual value in the following section:

<input id="password" class="margeTextInput" type="password" value="VMware1!"/>

Once you have saved your changes, you can then reload the browser and you should see that the vSphere Web Client now has both the username and password automatically pre-filled when the webpage loads.

More from my site

  • vYetti - Fun animated vSphere Login UI customization
  • Changing "Password will expire in X days" notification for Active Directory users in vSphere Web/H5 Client
  • Quick Tip - Enabling HTML5 VM Console in the vSphere Web Client for IE
  • My top 5 favorite enhancements to the new vSphere Web Client 5.5
  • How to recover VCSA 5.5 from an expired administrator account?

Categories // Security, vSphere 6.0, vSphere Web Client Tags // HTML5, password, security, username, vsphere web client

Comments

  1. *protectedpaulbraren says

    08/24/2015 at 3:44 pm

    Even better than using LastPass for this same purpose. Great idea!

    Reply
    • William Lam says

      08/24/2015 at 4:09 pm

      I normally use a Password Manager for variety of reasons/benefits but in the case where you don't want to rely on external systems or networking, this is the next best thing. This is especially useful for isolated/lab environments 🙂

      Reply
  2. *protectederikbussink says

    09/02/2015 at 8:03 am

    Thanks a lot for sharing this information.

    When using an external Platform Service Controller (PSC), you need to update the unpentry.jsp on the PSC.

    Reply
    • *protectederikbussink says

      12/09/2015 at 4:56 am

      Once more driven back to this great post !!!

      Reply
  3. *protectedHarold Schoofs says

    03/31/2016 at 8:02 am

    Awesome, and indeed, if using an external PSC, change the value there !

    Reply
  4. *protectedAskar Kopbayev says

    02/01/2017 at 10:58 pm

    Thanks. Worked in vSphere 6.5, but for some reasons the Login button is deactivated until I change at least one character in the User Name field

    Reply
    • *protectedAskar Kopbayev says

      02/01/2017 at 11:07 pm

      Well, it seems to be a default behaviour of the login web page which keeps Login button deactivated until Username field is changed

      Reply
      • William Lam says

        02/02/2017 at 5:34 am

        Yes, this is expected as the UI is ensuring there's actual user input and is not aware of the pre-filled credentials. Simply hit "tab" which brings cursor to password field and hit enter

        Reply
        • *protecteddmorse2112 says

          06/27/2017 at 7:03 am

          To always enable the login button, login to vCSA and edit /usr/lib/vmware-sso/vmware-sts/webapps/websso/resources/js/websso.js.

          Just above the "setCSDInstalled();" line, add a line that says "enableLoginButton();", and save. No restart needed, just refresh the login page.

          Reply
    • *protectedgomjaba says

      02/02/2017 at 2:17 am

      It seems you can still simply select the password field and hit enter 🙂

      Reply
  5. *protectedRahul says

    02/27/2017 at 8:21 am

    For ESXi host client for 6.5, is there a way to have pre-filled credentials?

    Reply
  6. *protectedAnoop says

    04/04/2017 at 7:38 am

    Thanks work like charm...!!!

    Reply
  7. *protectedDonald Tong says

    08/16/2017 at 12:54 am

    It is great! But I tried to replicate the method to ESXi host with no luck. There is a file /usr/lib/vmware/hostd/docroot/ui/views/login.html containing the required fields but changing it will have no effect. Even worse the changes will not be preserved after a reboot.

    Reply
  8. *protectedNik says

    03/06/2018 at 1:46 am

    Any idea how to do this for the vSphere web client for each of my ESXi servers as well please ?

    Reply
  9. *protectedSteve says

    06/26/2018 at 8:09 pm

    How do I clear all the list of users name from the text box? This is from the vsphere Web Client for VCSA 6.5 on Chrome browser.

    I tried to clear the Chrome browsing data, still I could not remove the list of users name from the text box?

    Reply
    • *protectedSteve says

      06/26/2018 at 8:20 pm

      Thanks. I have managed to clear that. One required to clear all browsing data. By default, it only clear the hourly.

      Reply
  10. *protectedJackie says

    10/11/2018 at 2:01 pm

    This really works. Thanks to William. Here is a more detailed step by step guide for the Linux newbee like myself:
    Go to vCenter Appliance machine or SSH to it:
    1. Login as root, password is the password for "*protected email*" one.
    2. type shell to enter the root command mode.
    3. type "cd /usr/lib/vmware-sso/vmware-sts/webapps/websso/WEB-INF/views/" to enter the directory where the file is.
    4. type "vi unpentry.jsp" to edit the file with VI.
    5. Edit the username line so that it goes like this: "".
    1) type "/id="username"" to locate to where the username is saved. Move the cursor to the start editing place.
    2) press "i" to start inserting text. press ESC key when done.
    3) press "x" to delete excessive text.
    6. Repeat step 5 to edit the password line so that it goes like this: "" where "Mypassword" is your own password.
    7. press ESC key to exit out of editing mode.
    8. type ZZ and press enter to exit VI and save the file.
    9. type "exit" to leave the shell. type "exit" again to log off.
    10. Open vCenter console in browser. The user name and password should already prefilled. But you need to put the cursor at the username field and press TAB key twice to activate the "login" button, once activated, press space or use the mouse to press the login button.

    Reply

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • VMUG Connect 2025 - Minimal VMware Cloud Foundation (VCF) 5.x in a Box  05/15/2025
  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...