0

I am building a c# mvc5 project which uses single sign-on authentication (identity framework). my client worked under the domain and he asked me to allow the only CEO to log in automatically by his NTLogin without the need to insert the given username & password.

my approach was to use the user NTLOGIN name as the username in the single sign in, so I will register an account to CEO using username same as his NT login username. when the application page get launch I want to read the client local pc username (domain\username) and check in the database if exists and allow to auto login, if true then create an auto sign in by identity framework and redirect the client to the home page. if false then redirect the client to the login page to login using the normal way provided.

the issue:- how could I get the actual client local pc username not the IIS server user.

I tried the way which uses the javascript to read the current username but it needs for Activex which I don't want to use. also, i tried to use windows authentication but it always asks for user credentials.

help me please to find any solution to correct my approach.

  • Have u tried this: `System.Security.Principal.WindowsIdentity.GetCurrent().Name` – Gamal Mohamed Sep 03 '17 at 20:46
  • yes i did this will work only after the page asks the client to enter his credentials . i dont want to ake for credentials. – Yasser Ahmed Sep 04 '17 at 04:19
  • Is the c# web application has the functionality to read client pc logged username or read the user profile name & client pc name ? – Yasser Ahmed Sep 04 '17 at 07:20
  • same issue without solution yet. https://stackoverflow.com/questions/23695993/how-to-find-out-the-name-of-currently-logged-in-user-in-asp-net – Yasser Ahmed Sep 04 '17 at 08:38

0 Answers0