Skip to content
Snippets Groups Projects
Commit 00c62667 authored by Tyler Antonio's avatar Tyler Antonio
Browse files

Updates to documentation

parent 860b451d
No related branches found
No related tags found
No related merge requests found
...@@ -15,18 +15,18 @@ Introduction ...@@ -15,18 +15,18 @@ Introduction
If you want to run a clustered simpleSAMLphp IdP service and you would like to have centralized storage for metadata, you can use the PDO metadata storage handler. If you want to run a clustered simpleSAMLphp IdP service and you would like to have centralized storage for metadata, you can use the PDO metadata storage handler.
The present document explains how to configure simpleSAMLphp and your database. The present document explains how to configure SimpleSAMLphp and your database.
Preparations Preparations
------------ ------------
You will need to have the appropriate PDO drivers for your database. You will need to have the appropriate PDO drivers for your database and you will have to configure the database secion within the config/config.php file.
Configuring the simpleSAMLphp Configuring SimpleSAMLphp
----------------------------- -----------------------------
You will first need to configure a PDO metadata source. You will first need to configure a PDO metadata source.
...@@ -37,12 +37,7 @@ Here is an example of flatfile plus PDO: ...@@ -37,12 +37,7 @@ Here is an example of flatfile plus PDO:
'metadata.sources' => array( 'metadata.sources' => array(
array('type' => 'flatfile'), array('type' => 'flatfile'),
array('type' => 'pdo', array('type' => 'pdo'),
'dsn' => 'mysql:host=localhost;dbname=saml',
'username' => 'simplesamlphp',
'password' => 'SuperSecretPassword',
'usePersistentConnection' => FALSE,
),
), ),
...@@ -81,4 +76,4 @@ To import all flatfile metadata files into the PDO database, run the following s ...@@ -81,4 +76,4 @@ To import all flatfile metadata files into the PDO database, run the following s
[root@simplesamlphp simplesamlphp]# php bin/importPdoMetadata.php [root@simplesamlphp simplesamlphp]# php bin/importPdoMetadata.php
In the event that you import a metadata for an entity id that already exists in the database, it will be overwritten. In the event that you import a metadata for an entity id that already exists in the database, it will be overwritten.
\ No newline at end of file
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
* @author Tyler Antonio, University of Alberta <tantonio@ualberta.ca> * @author Tyler Antonio, University of Alberta <tantonio@ualberta.ca>
* @package simpleSAMLphp * @package simpleSAMLphp
*/ */
class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_MetaDataStorageSource{ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_MetaDataStorageSource{
/** /**
...@@ -63,7 +64,7 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_ ...@@ -63,7 +64,7 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_
* *
* - 'password': Password for the database user. * - 'password': Password for the database user.
* *
* @param $config An associtive array with the configuration for this handler. * @param array $config An associtive array with the configuration for this handler.
*/ */
public function __construct($config) { public function __construct($config) {
assert('is_array($config)'); assert('is_array($config)');
...@@ -79,8 +80,8 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_ ...@@ -79,8 +80,8 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_
* This function loads the given set of metadata from a file our configured database. * This function loads the given set of metadata from a file our configured database.
* This function returns NULL if it is unable to locate the given set in the metadata directory. * This function returns NULL if it is unable to locate the given set in the metadata directory.
* *
* @param $set The set of metadata we are loading. * @param string $set The set of metadata we are loading.
* @return Associative array with the metadata, or NULL if we are unable to load metadata from the given file. * @return array $metadata Associative array with the metadata, or NULL if we are unable to load metadata from the given file.
*/ */
private function load($set) { private function load($set) {
assert('is_string($set)'); assert('is_string($set)');
...@@ -110,7 +111,7 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_ ...@@ -110,7 +111,7 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_
* Retrieve a list of all available metadata for a given set. * Retrieve a list of all available metadata for a given set.
* *
* @param string $set The set we are looking for metadata in. * @param string $set The set we are looking for metadata in.
* @return array An associative array with all the metadata for the given set. * @return array $metadata An associative array with all the metadata for the given set.
*/ */
public function getMetadataSet($set) { public function getMetadataSet($set) {
assert('is_string($set)'); assert('is_string($set)');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment