I have been doing some automation with NSX-T 2.5 lately and for troubleshooting and validation purposes, I obviously make use of the NSX-T UI. After each new deployment I need to login to verify a few things. Out of pure laziness, I really would like to be able to login with just a single click for development purposes. I certainly could use password manager but it would still be a couple of clicks but I was looking something slightly quicker and that could easily work in a number of environments that I have.
Looking around the filesystem of the NSX Unified Appliance, I found the structure for the login UI to be fairly similiar (thanks to VMware Clarity) to that of the vCenter Server Appliance (VCSA). I found that I could apply the same techniques I had used to customize the VCSA Login UI including setting up pre-filled credentials (no recommended for obvious reasons) on the NSX-T Appliance.
Disclaimer: This is not officially supported by VMware, use at your own risk. Please make sure to perform a backup of all original files prior to editing in case you need to restore back the system defaults.
If you wish to hardcode the username and/or password, you will need to login as root and modify /opt/vmware/proxy-tomcat/webapps/ROOT/login.jsp and below is an example:
<input class="username" type="text" id="username" name="j_username" autocomplete="off"
<input class="password" type="password" id="password" name="j_password" autocomplete="off"
If want your changes to persist a reboot, you will need to extract /opt/vmware/proxy-tomcat/webapps/ROOT.war and make the changes and repackage the WAR file.
While I was at this, I figure why not update the boring background as well? 🙂 This is certainly a be a bit more involved, especially as the CSS file contents are minify to a single line which you will need to un-minify. If you wish to play around with the login UI background, you can take a look at /opt/vmware/proxy-tomcat/webapps/ROOT/reverse-proxy/styles/clarity-ui.min.css and to persist the configurations, you will also need to incorporate the changes into the ROOT.war file.