Apache-AuthDigest

 view release on metacpan or  search on metacpan

Session/Session.pm  view on Meta::CPAN

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  my $cfg = Apache::ModuleConfig->get($r, __PACKAGE__);
 
  my $key = $cfg->{_session};
 
  my $nonce = $r->notes($key);
 
  unless ($nonce) {
    $log->info('Apache::AuthDigest::API::Session - no session found for ',
               "session key $key, using default request time instead");
 
    return $r->SUPER::note_digest_auth_failure;
  }
 
  $log->info("Apache::AuthDigest::API::Session - using notes() key $key ",
             "with session $nonce");
 
  my $auth_name = $r->auth_name;
  my $header_type = $r->proxyreq ? 'Proxy-Authenticate' : 'WWW-Authenticate';
 
  my $header_info = qq!Digest realm="$auth_name", nonce="$nonce"!;
                        
 
  $r->err_headers_out->set($header_type => $header_info);
}
 
sub compare_digest_response {
 
  my $r = shift;
 
  my $rc = $r->SUPER::compare_digest_response(@_);
 
  return unless $rc;
 
  my ($key, $session) = $r->get_session;
 
  $r->notes($key => $session);
 
  return $rc;
}



( run in 0.304 second using v1.01-cache-2.11-cpan-26ccb49234f )