Page 1 of 1

Read user's credentials

Posted: Wed Jul 10, 2002 3:21 am
by Geschi
I've been wonderung for a while now if it possible to grant access to a local intranet by just reading the user's credentials.
The main idea is to allow certain groups to see different information based on who they are. I don't want to make the user log in, nor use cookies, but identify the user by his/her credentials meaning the user name (all nt clients).
Does anybody know a way to do this?
Thanks in advance.

Posted: Wed Jul 10, 2002 3:35 am
by twigletmac
Have a look at this thread:
http://www.devnetwork.net/forums/viewtopic.php?t=1174
Server side and client side solutions are both discussed.

Mac

Posted: Wed Jul 10, 2002 8:09 am
by Geschi
Thought about using VBScript before, unfortunately my admin doesn't allow it. Is there another way to do it?
There's nothing in the other thread. Or did i miss something?

Posted: Wed Jul 10, 2002 8:14 am
by twigletmac
Is it not possible for you to get the details server side? The VBScript thingie is the only client side solution I've seen for this.

Mac

Client Side Issue

Posted: Wed Jul 10, 2002 10:56 am
by Geschi
Well, have to check the server side details again, but i guess it won't work out. It is pretty much the same problem as Hebbs' ( thanks for the hint that there's already a thread, will probably contact Hebbs to how it worked.)
However the problem still exists - though it can be done in ASP and VBScript.
I got an apache webserver running on linux. All clients in the intranet use Win NT. There shall be at least 2 different groups of users: employees and admins. I could grant access using the IP# in Apache's .htaccess, but admins won't be able to acces from any client. Therefore using the logged on user's credentials would be the most effective method, since the use of cookies is a security hole. Unfortunately, there's no easy way to get user's hardware or software details on Win NT. Or am I wrong?
Keep looking...

Posted: Thu Jul 11, 2002 3:44 am
by mikeq
I don't think there is anyway to get the details at your webserver unless they have been passed by somethng running on the client. This is the way things like Novells single sign-on works, little application runs on the client passing info to the servers.

Posted: Mon Jul 15, 2002 8:10 am
by Wayne
Hi guys,

The VBScript code is now also possible in JScript, which runs on IE5.5 and IE6, Im not sure about Netscape compatability though. But it still requires ActiveX to be enabled on the client machines browser.

I havent tested this properly but it works on my machine. Heres is the JScript version:

Code: Select all

function GetUser(){

	Platform=navigator.userAgent;
	Sh = new ActiveXObject("WScript.Shell");
	if (Platform.indexOf("Windows 98") >= 0){
		RegKey = "HKEY_LOCAL_MACHINE\\Network\\Logon&quote;;
		UserName = Sh.RegRead (RegKey + "username");
		Platform = "Windows 95";
	}  
 	if (Platform.indexOf("Windows 95") >= 0) {
		RegKey = "HKEY_LOCAL_MACHINE\\Network\\Logon&quote;;
		UserName = Sh.RegRead (RegKey + "username");
		Platform = "Windows 98";
	}
	if (Platform.indexOf("Windows 2000") >= 0 ) {
		RegKey = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer&quote;;
		UserName = Sh.RegRead (RegKey + "Logon User Name");
		Platform = "Windows 2000";
	}
	if (Platform.indexOf("Windows NT") >= 0 ) {
		RegKey = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer&quote;;
		UserName = Sh.RegRead (RegKey + "Logon User Name");
		Platform = "Windows NT/XP";
    }
    
	if (UserName != "") {
		document.location = "Your.URL.Here?username=" + UserName;   //auto login
	} else {
		document.location = "Your.URL.Here";  //prompt for login
    }

}