diff options
| author | Christophe Nowicki <cnowicki@easter-eggs.com> | 2005-01-18 14:46:45 +0000 |
|---|---|---|
| committer | Christophe Nowicki <cnowicki@easter-eggs.com> | 2005-01-18 14:46:45 +0000 |
| commit | 5779be82a85d9771e97c364e39716b424fe59de1 (patch) | |
| tree | 612a9c9d14d1893b5145200a6cac15d8a295d562 /php/Attic/examples/sample-idp/setup.php | |
| parent | dd1a48be767f5fc87d58d3ee1216675c033cc94b (diff) | |
| download | lasso-5779be82a85d9771e97c364e39716b424fe59de1.tar.gz lasso-5779be82a85d9771e97c364e39716b424fe59de1.tar.xz lasso-5779be82a85d9771e97c364e39716b424fe59de1.zip | |
fix LassoServer call
Diffstat (limited to 'php/Attic/examples/sample-idp/setup.php')
| -rw-r--r-- | php/Attic/examples/sample-idp/setup.php | 41 |
1 files changed, 30 insertions, 11 deletions
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 "<br>$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 "<br>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 "<br>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 @@ <td>Metadata :</td><td><input type='text' name='idp-metadata' size='50' value='<?php echo $config['idp-metadata']; ?>'></td><td> </td> </tr> + <tr> - <td>Public Key :</td><td><input type='text' name='idp-public_key' size='50' value='<?php echo $config['idp-public_key']; ?>'></td><td> </td> + <td>Private Key :</td><td><input type='text' name='idp-private_key' size='50' value='<?php echo $config['idp-private_key']; ?>'></td><td> </td> </tr> <tr> - <td>Private Key :</td><td><input type='text' name='idp-private_key' size='50' value='<?php echo $config['idp-private_key']; ?>'></td><td> </td> + <td>Secret Key (optional) :</td><td><input type='text' name='idp-secret_key' size='50' value='<?php echo $config['idp-secret_key']; ?>'></td><td> </td> </tr> <tr> |
