Plan for failures, hope for success!
Show Domain and Username On Citrix Web Interface 5.4
I have a few domains I log in to for Citrix, but the Web Interface only shows you the username that you are logged into, not the domain. With this hack that I came up with, you will be able to show the domain and username of the logged in user in the “Domain\Username” format with Citrix Web Interface 5.4, it may work on other versions, but I haven’t tested it, so I dont know.
- Navigate to your Inetpub folder, and under the folder for your web interface search for the file “StandardLayout.java”, for me it was located at “Inetpub\wwwroot\Citrix\XenApp\app_code\PagesJava\com\citrix\wi\pages”
- Open the file “StandardLayout.java” and find the line that shows
1String username = getUsernameFromAccessToken();
Comment out the line, so it looks like
1//String username = getUsernameFromAccessToken(); - Under our commented line above paste this code
1String username = getDomainANDUserFromAccessToken(); - Now find the line that shows
1private String getUsernameFromAccessToken()
This is the function above that we just commented out - Right bellow that function, paste this function
1234567891011121314151617181920212223242526/**Custom Code by Pinchii - http://pinchii.com/home/2011/08/show-domain-and-username-on-ci * Gets the domain and user from the current primary access token, or provides a* null substitute if no domain is available.** @return the domain and user as a string*/private String getDomainANDUserFromAccessToken(){String Userdomain = null;AccessToken accessToken = Authentication.getPrimaryAccessToken(wiContext.getWebAbstraction());if (accessToken != null){ // defensive - this should never be nullif (accessToken instanceof GuestToken){// Anonymous user so use a localised stringUserdomain = "";}else{// Can get the actual username for all other tokensUserdomain = accessToken.getUserIdentity();}}return Userdomain;} - That’s all there is to it, now when you log in to your web interface, instead of just showing the user name, it will show the domain as well
Comments are closed.