Automatic authentication on NT network???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Hebbs
Forum Commoner
Posts: 43
Joined: Mon Apr 22, 2002 9:34 pm
Location: Perth, Western Australia

Combining VBScripts with PHP

Post by Hebbs »

I have got back to this after a bit of a break on other tasks.

I havent used VBScripts before but have managed to get most of Waynes code working.

The problem Im having is with the line

Code: Select all

if UserName <> "Unknown" then 
      document.location = "autologon.php?username=" & UserName
I presume this should carry the value of username to a autologon.php page, however I keep getting a recurring error message at this point saying that there is an error on this line with the description "

object required. 'document'

I have created the autologon.php script and it is in the same directory as the running script.

Any ideas?

Hebbs
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

That sounds a little funny, but anyway, if the script is included and called correctly from the html page that you are calling, the only thing I can think of is try changing the

Code: Select all

document.location
to

Code: Select all

window.location
Hebbs
Forum Commoner
Posts: 43
Joined: Mon Apr 22, 2002 9:34 pm
Location: Perth, Western Australia

Post by Hebbs »

Wayne,

I have never played with VBScript before and am thinking I might have something simple wrong here.

In your original post you provided this:

Code: Select all

<script TYPE="text/vbscript" language="VBScript" src="scripts.vbs">
I understand that this goes in the header of the calling html page and that the actual script sits in the src 'scripts.vbs'. I take it that this page executes the subroutine from scripts.vbs and should then carry the value direct to autologin.php, Yes?

What I have is three pages.

The first is the initiating page which calls the sub, I have it like this:

Code: Select all

<html>
<head>
    <script TYPE="text/vbscript" language="VBScript" src="scripts.vbs">

	<body onLoad="User();">
</script>
</head>

</body>
</html>
The second page is the scripts.vbs.

The third is the php page in which Im testing for the variable, something like this:

Code: Select all

<html>
<head>
	<title>Untitled</title>
</head>

<body>
<?php
echo "Username = $username";
?>
</body>
</html>
Having read your last I think I may have the bull by the wrong end. Can you confirm/deny this for me?

Hebbs
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

Your probably right, it looks like these changes should do it. Change your first page to this.

Code: Select all

<html> 
<head> 
    <script TYPE="text/vbscript" language="VBScript" src="scripts.vbs"> 
    </script> 
</head> 

<body onLoad="User();"> 

</body> 
</html>
firepages
Forum Newbie
Posts: 5
Joined: Sun Jul 28, 2002 4:22 am
Location: Perth::Australia

Post by firepages »

If you are running apache just use mod_sspi or any of the NT authentication modules that are out there http://modules.apache.org/
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

(in addition to the last post)
Yesterday configuring a new apache installation I stumbled (accidentally) over Kerberos Apache module.
it retrieves a username/password pair from the browser and checks them against a Kerberos server as set up by your particular organization.
w2k/active directory uses kerberos for authentication by default.
I have no w2k server at hand so can't test it....
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

does anyone know if these programs/modules will work if your http requests are passed through a proxy server??
Post Reply