Raja

Raja

  • NA
  • 2k
  • 358.6k

How to set single sign on asp.net c#?

Feb 14 2017 4:26 AM
i want to set single sign on to application using system user name.
 
my comuter name is raja and user name is admin
 
i use many codes
 
string Domain = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName;
string Host = System.Net.Dns.GetHostName();
string USER = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
System.Net.IPHostEntry host = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());
all is working in my local machine fine but i host the application to server the code  is does not get the username of local system this is get only hosted name if i host the application name of 'test' the codes get only test.

i want local system name
 
local system name is 'rjk'

application login to without ask username and password

all of the user have the rjk keyword so

if(LOGIN_USER.Contains("rjk"))
{
//successfully login
}

 how to do it.
 
 

Answers (4)