From 5779be82a85d9771e97c364e39716b424fe59de1 Mon Sep 17 00:00:00 2001 From: Christophe Nowicki Date: Tue, 18 Jan 2005 14:46:45 +0000 Subject: fix LassoServer call --- php/Attic/examples/sample-idp/setup.php | 41 ++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'php/Attic/examples/sample-idp/setup.php') diff --git a/php/Attic/examples/sample-idp/setup.php b/php/Attic/examples/sample-idp/setup.php index 6aa7f613..5a5dde85 100644 --- a/php/Attic/examples/sample-idp/setup.php +++ b/php/Attic/examples/sample-idp/setup.php @@ -44,9 +44,13 @@ { print "
$key : "; - $ret = $server->addProvider($item['metadata'], $item['public_key'], $item['ca']); + $ret = $server->addProvider(LASSO_PROVIDER_ROLE_SP, + $item['metadata'], + $item['public_key'], + $item['ca']); - /*if ($ret != TRUE) + /* FIXME : check addProvider return value + if ($ret != TRUE) { print "Failed"; break; @@ -81,8 +85,8 @@ 'log_handler' => 'sql', 'auth_type' => 'auth_form', 'idp-metadata' => $cwd . "/metadata_idp1.xml", - 'idp-public_key' => $cwd . "/public-key_idp1.pem", 'idp-private_key' => $cwd . "/private-key-raw_idp1.pem", + 'idp-secret_key' => "", 'idp-ca' => $cwd . "/certificate_idp1.pem", 'sp' => array( 'sp1' => array( @@ -97,9 +101,10 @@ )); $config_ser = serialize($config); - if (!write_config_inc($config)) - die("Could not write default config file"); + die("Could not write default config file, + if you get a \"permission denied\" error, check the owner of the + sample directory. (it must be www-data)."); } else { @@ -333,7 +338,10 @@ print "
Check file " . $config[$file] . " : "; if (!file_exists($config[$file])) { - die("Failed (file does not exist)"); + if ($file == 'idp-secret_key') + print "not found (optional)"; + else + die("Failed (file does not exist)"); } else print "OK"; @@ -359,9 +367,19 @@ print "
Create Server : "; - $server = new LassoServer($config['idp-metadata'], - $config['idp-public_key'], $config['idp-private_key'], - $config['idp-ca'], lassoSignatureMethodRsaSha1); + /* + $server = new LassoServer( + $config['idp-metadata'], + $config['idp-public_key'], + $config['idp-private_key'], + $config['idp-ca']); + */ + + $server = new LassoServer( + $config['idp-metadata'], + $config['idp-private_key'], + $config['idp-secret_key'], + $config['idp-ca']); if (empty($server)) die("Failed"); @@ -494,12 +512,13 @@ Metadata :'>  + - Public Key :'>  + Private Key :'>  - Private Key :'>  + Secret Key (optional) :'>  -- cgit