![]() |
![]() |
![]() |
Authorisation script
if ($ENV{'REMOTE_USER'} ne "robin") {&throw401; print "<html><head><title>Invalid user </title></head><body><h1>I have no record of User $ENV{'REMOTE_USER'} </h1></body></html> "; exit;} print "HTTP/1.0 201 Ok \n"; print "Content-type:text/html\n\n"; print "<html><head><title>You made it</title></head><body><h1>you made it, $ENV{'REMOTE_USER'} </h1></body></html> "; foreach $key (keys %ENV) { printf "$key = $ENV{$key}<BR> \n"; } } sub throw401 { print "HTTP/1.0 401 Access Denied\n"; print "WWW-Authenticate: Basic\n"; print "WWW-Authenticate: NTLM\n"; print "Content-Length: 24\n\n"; } Download the scriptFor more info on authorisation try the Microsoft Knowledge base
Copyright © Robin S. Chatterjee. All rights reserved.
![]() |
![]() |
![]() |
This page hosted by
Get your own Free Home Page