Apache-AuthCookieNTLM

 view release on metacpan or  search on metacpan

lib/Apache/AuthCookieNTLM.pm  view on Meta::CPAN

This is an example of how to set your cookie values with whatever 
data you want.

  package MYAuthenNTLM;

  use Apache::AuthCookieNTLM;	
  use base ( 'Apache::AuthCookieNTLM' );
  use MyUserLookup_Package;
  
  sub choose_cookie_values {
    my ($self,$r) = @_;
	
    # Save if it's not already set
    if ($self->check_cookie()) {
		# Look up against other sources
	    my $person = MyUserLookup_Package->new($self->{'username'});

        $self->set_cookie({
            'email'	=> $person->email(),
            'shoe_size' => $person->shoe_size(),
        });
    }
  }
  1;

'username' and 'userdomain' are set automatically, though you 
can override them, they are used to set the REMOTE_USER value.

=head1 COMMON PROBLEMS

First test Apache::AuthenNTLM directly without this module.

=head2 NTLM Authentication

If you get prompted for a login / passwd / domain IE probably isn't 
sending the NTLM information. Ensure that IE sees the server as a 
'trusted' intranet site  (and therefor sends the username). You 
should be  able to set this as a policy across your network, or on 
each machine:

'Tools' -> 'Internet Options' -> 'Security' -> 'Local Intranet' ->
'Sites' -> 'Advanced' and add it in there, this must start
with http:// or https://

Once this is working you should be able to just replace

  PerlAuthenHandler Apache::AuthenNTLM

with		
		
  PerlAuthenHandler Apache::AuthCookieNTLM

And have it all just work[tm].

Remember to quit IE and reload as it's crap at implementing
changes on the fly!

=head2 Not setting cookies

IE doesn't seem to alert you (if you've turned prompt on 
for cookies). We guess it's because its from the trusted site.

Also check your using the right domain, as can be
seen when you turn debug on.

=head2 access to /test failed in error log - but it works

Because Apache::AuthenNTLM has to go through several loops
the first of which will fail, this will be reported in
your error log, but you can just ignore it.

=head1 SEE ALSO

L<Apache::AuthenNTLM>,
L<Apache::Cookie>,
L<CGI::Cookie>

=head1 AUTHOR

Leo Lapworth <llap@cuckoo.org>, Francoise Dehinbo

=cut



( run in 0.763 second using v1.01-cache-2.11-cpan-e1769b4cff6 )