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

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.

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:

Reader Interactions

Comments

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 🙂

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.

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 “administrator@vcenter.local” 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.

Primary Sidebar

Search this website

Author

William Lam is a Staff Solutions Architect working in the VMware Cloud on AWS team within the Cloud Platform Business Unit (CPBU) at VMware. He focuses on Automation, Integration and Operation of the VMware Software Defined Datacenter (SDDC).