How can i get Windows Username OR Computername

Hi,

ist there an way to get the Windows Username or Computername of the Appsmith Client.
I do not mean the values of {{appsmith.user.name}}

i tried :

    var WinNetwork = new ActiveXObject("WScript.Network");
    alert(WinNetwork.UserName); 

but didn´t work for me.

thx
Franz

This is not possible at this juncture. Although, could you please explain how this will help you?

I have a database of internal users and it would be useful to display only the data of the user who opens the Appsmith App.

To do that you have to use windows integrated authentication, provided by IIS (included in windows server). So that is possible but is a bit convoluted. You need an IIS server, a folder with WIA on, and then make a request to a file in that folder. Then this file must have code (eg a .ashx file in C#) to identify the user and return that info to the browser. So you see, it’s a lot of steps just to get the windows user. And an authentication window could pop up if the user hasn’t logged in into that server before…

thanks for you help. I solved it in a different way.
The opening URL is containing now the User and Computername.

and can you briefly describe how you did it. Thank you

i send each user the Link to the app like:
[URL]?user=Username?pcname=testcomputer

and then using the Parameters in the App to Show Specific Data:
{{appsmith.URL.queryParams.user}}
{{appsmith.URL.queryParams.pcname}}

and how do you stop them from impersonating anyone else by changing the url parameters manually?

In my use case it doesn’t matter. if the PC and username not fit together there is no result and it is an internal Applikation.

but you are are right, normally I would prefer an more secure way.