File: test_digest_simple.php

package info (click to toggle)
php-auth-http 2.1.6-3
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 88 kB
  • ctags: 120
  • sloc: php: 454; xml: 322; makefile: 49; sql: 10
file content (24 lines) | stat: -rw-r--r-- 613 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
require_once "Auth/HTTP.php";
define('DSN','sqlite://dummy:@localhost//tmp/user.db?mode=0644');

$options = array('dsn'=>DSN, 'authType'=>'digest');
$auth = new Auth_HTTP("DB", $options);

$auth->setRealm('dummy', 'sample');
$auth->start();

?>
<html>
<head><title>HTTP digest authentication test for simple case</title></head>
<body>
<?php
print "auth: ".$auth->authType."<br />";
print "username: ".$auth->username."<br />";
print "password: ".$auth->password."<br />";
print "auth: ".print_r($auth->auth)."<br />";
if($auth->getAuth()) {
  print "authentication is succeeded.<br />";
}
?>
</body></html>