WebSphere Application Server & Liberty

 View Only

Can I use non-English username to login to the Liberty AdminCenter?

By Hiroko Takamiya posted Tue October 05, 2021 03:12 PM


Can I use non-English username to login to the Liberty Admin Center?

Recently, a customer asked us if it is possible to use a non-English username to login to the AdminCenter login.  I became curious and tried it out. 

It turned it only takes one line  "-Dclient.encoding.override=UTF-8" added to the jvm.options to achieve this goal. Once the jvm.options file was created with this setting and the server was restarted, the Admin Center started to handle the username as UTF-8 encoded text. 

I went on to try the double-byte as the password.  I was not able to use the Windows Input Method in the password entry field  However, when the value is copied and pasted into the password field, the user was able to login.  This experiment is performed with the file based registry defined in the server.xml. 

The outcome will depend on how the backend user registry handles the input characters.  Liberty will just pass the original string encoded in the UTF-8 to the user registry.  

In the example below, I tested with double-byte characters.  
Login with DBCS username

The user is able to login successfully and showed up in the user profile section. 

<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">

<!-- Enable features -->

<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint id="defaultHttpEndpoint"
 httpsPort="9443" />

<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>

<!-- Default SSL configuration enables trust for default certificates from the Java runtime -->
<ssl id="defaultSSLConfig" trustDefaultCerts="true" />

<basicRegistry realm="basicRealm">
   <user name="管理者" password="秘密"/>  <!-- if the password is pasted into the entry field, it worked with basic registry -->
   <user name="Administrator" password="password"/>


# This enabled UTF-8 encoded input 

How do I change the language of the Liberty log and trace? 

While I was on the language topic,  I also checked how I can change the languages for the Liberty log and trace.  Following one line did it.  

# This example is for Japanese

The language list and the value to set can be found  here.  

Note:  adminCenter-1.0 feature can be added the installUtility.  In the "\wlp\bin" directory, "./installUtility.bat install adminCenter-1.0"  will download and install the feature.  (On the Linux environment, "/wlp/bin/installUtility" ) 

This was a fun experiment. If the reader of this blog is aware of cool and useful jvm.options, kindly share in the comment section.  Thank you!