dazimo

config.php

Feb 22nd, 2023 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 43.61 KB | None | 0 0
  1. /**
  2.  * The configuration of SimpleSAMLphp
  3.  */
  4.  
  5. $config = [
  6.  
  7.     /*******************************
  8.      | BASIC CONFIGURATION OPTIONS |
  9.      *******************************/
  10.  
  11.     /*
  12.      * Setup the following parameters to match your installation.
  13.      * See the user manual for more details.
  14.      */
  15.  
  16.     /*
  17.      * baseurlpath is a *URL path* (not a filesystem path).
  18.      * A valid format for 'baseurlpath' is:
  19.      * [(http|https)://(hostname|fqdn)[:port]]/[path/to/simplesaml/]
  20.      *
  21.      * The full url format is useful if your SimpleSAMLphp setup is hosted behind
  22.      * a reverse proxy. In that case you can specify the external url here.
  23.      *
  24.      * Please note that SimpleSAMLphp will then redirect all queries to the
  25.      * external url, no matter where you come from (direct access or via the
  26.      * reverse proxy).
  27.      */
  28.     'baseurlpath' => 'auth/',
  29.  
  30.     /*
  31.      * The 'application' configuration array groups a set configuration options
  32.      * relative to an application protected by SimpleSAMLphp.
  33.      */
  34.     //'application' => [
  35.         /*
  36.          * The 'baseURL' configuration option allows you to specify a protocol,
  37.          * host and optionally a port that serves as the canonical base for all
  38.          * your application's URLs. This is useful when the environment
  39.          * observed in the server differs from the one observed by end users,
  40.          * for example, when using a load balancer to offload TLS.
  41.          *
  42.          * Note that this configuration option does not allow setting a path as
  43.          * part of the URL. If your setup involves URL rewriting or any other
  44.          * tricks that would result in SimpleSAMLphp observing a URL for your
  45.          * application's scripts different than the canonical one, you will
  46.          * need to compute the right URLs yourself and pass them dynamically
  47.          * to SimpleSAMLphp's API.
  48.          */
  49.         //'baseURL' => 'https://example.com',
  50.     //],
  51.  
  52.     /*
  53.      * The following settings are *filesystem paths* which define where
  54.      * SimpleSAMLphp can find or write the following things:
  55.      * - 'certdir': The base directory for certificate and key material.
  56.      * - 'loggingdir': Where to write logs.
  57.      * - 'datadir': Storage of general data.
  58.      * - 'tempdir': Saving temporary files. SimpleSAMLphp will attempt to create
  59.      *   this directory if it doesn't exist.
  60.      * When specified as a relative path, this is relative to the SimpleSAMLphp
  61.      * root directory.
  62.      */
  63.     'certdir' => 'cert/',
  64.     'loggingdir' => 'log/',
  65.     'datadir' => 'data/',
  66.     'tempdir' => '/tmp/simplesaml',
  67.  
  68.     /*
  69.      * Some information about the technical persons running this installation.
  70.      * The email address will be used as the recipient address for error reports, and
  71.      * also as the technical contact in generated metadata.
  72.      */
  73.     'technicalcontact_name' => 'Dimpizzy',
  74.     'technicalcontact_email' => '[email protected]',
  75.  
  76.     /*
  77.      * (Optional) The method by which email is delivered.  Defaults to mail which utilizes the
  78.      * PHP mail() function.
  79.      *
  80.      * Valid options are: mail, sendmail and smtp.
  81.      */
  82.     //'mail.transport.method' => 'smtp',
  83.  
  84.     /*
  85.      * Set the transport options for the transport method specified.  The valid settings are relative to the
  86.      * selected transport method.
  87.      */
  88.     // // smtp mail transport options
  89.     // 'mail.transport.options' => [
  90.     //     'host' => 'mail.example.org', // required
  91.     //     'port' => 25, // optional
  92.     //     'username' => '[email protected]', // optional: if set, enables smtp authentication
  93.     //     'password' => 'password', // optional: if set, enables smtp authentication
  94.     //     'security' => 'tls', // optional: defaults to no smtp security
  95.     // ],
  96.     // // sendmail mail transport options
  97.     // 'mail.transport.options' => [
  98.     //     'path' => '/usr/sbin/sendmail' // optional: defaults to php.ini path
  99.     // ],
  100.  
  101.     /*
  102.      * The envelope from address for outgoing emails.
  103.      * This should be in a domain that has your application's IP addresses in its SPF record
  104.      * to prevent it from being rejected by mail filters.
  105.      */
  106.     //'sendmail_from' => '[email protected]',
  107.  
  108.     /*
  109.      * The timezone of the server. This option should be set to the timezone you want
  110.      * SimpleSAMLphp to report the time in. The default is to guess the timezone based
  111.      * on your system timezone.
  112.      *
  113.      * See this page for a list of valid timezones: http://php.net/manual/en/timezones.php
  114.      */
  115.     'timezone' => 'America/New_York',
  116.  
  117.  
  118.  
  119.     /**********************************
  120.      | SECURITY CONFIGURATION OPTIONS |
  121.      **********************************/
  122.  
  123.     /*
  124.      * This is a secret salt used by SimpleSAMLphp when it needs to generate a secure hash
  125.      * of a value. It must be changed from its default value to a secret value. The value of
  126.      * 'secretsalt' can be any valid string of any length.
  127.      *
  128.      * A possible way to generate a random salt is by running the following command from a unix shell:
  129.      * LC_CTYPE=C tr -c -d '0123456789abcdefghijklmnopqrstuvwxyz' </dev/urandom | dd bs=32 count=1 2>/dev/null;echo
  130.      */
  131.     'secretsalt' => '**********',
  132.  
  133.     /*
  134.      * This password must be kept secret, and modified from the default value 123.
  135.      * This password will give access to the installation page of SimpleSAMLphp with
  136.      * metadata listing and diagnostics pages.
  137.      * You can also put a hash here; run "bin/pwgen.php" to generate one.
  138.      */
  139.     'auth.adminpassword' => '***********',
  140.  
  141.     /*
  142.      * Set this options to true if you want to require administrator password to access the web interface
  143.      * or the metadata pages, respectively.
  144.      */
  145.     'admin.protectindexpage' => false,
  146.     'admin.protectmetadata' => false,
  147.  
  148.     /*
  149.      * Set this option to false if you don't want SimpleSAMLphp to check for new stable releases when
  150.      * visiting the configuration tab in the web interface.
  151.      */
  152.     'admin.checkforupdates' => true,
  153.  
  154.     /*
  155.      * Array of domains that are allowed when generating links or redirects
  156.      * to URLs. SimpleSAMLphp will use this option to determine whether to
  157.      * to consider a given URL valid or not, but you should always validate
  158.      * URLs obtained from the input on your own (i.e. ReturnTo or RelayState
  159.      * parameters obtained from the $_REQUEST array).
  160.      *
  161.      * SimpleSAMLphp will automatically add your own domain (either by checking
  162.      * it dynamically, or by using the domain defined in the 'baseurlpath'
  163.      * directive, the latter having precedence) to the list of trusted domains,
  164.      * in case this option is NOT set to NULL. In that case, you are explicitly
  165.      * telling SimpleSAMLphp to verify URLs.
  166.      *
  167.      * Set to an empty array to disallow ALL redirects or links pointing to
  168.      * an external URL other than your own domain. This is the default behaviour.
  169.      *6950me9pu4nf2khjc9s75j8pfm0f5xzd
  170.      * Set to NULL to disable checking of URLs. DO NOT DO THIS UNLESS YOU KNOW
  171.      * WHAT YOU ARE DOING!
  172.      *
  173.      * Example:
  174.      *   'trusted.url.domains' => ['sp.example.com', 'app.example.com'],
  175.      */
  176.     'trusted.url.domains' => [],
  177.  
  178.     /*
  179.      * Enable regular expression matching of trusted.url.domains.
  180.      *
  181.      * Set to true to treat the values in trusted.url.domains as regular
  182.      * expressions. Set to false to do exact string matching.
  183.      *
  184.      * If enabled, the start and end delimiters ('^' and '$') will be added to
  185.      * all regular expressions in trusted.url.domains.
  186.      */
  187.     'trusted.url.regex' => false,
  188.  
  189.     /*
  190.      * Enable secure POST from HTTPS to HTTP.
  191.      *
  192.      * If you have some SP's on HTTP and IdP is normally on HTTPS, this option
  193.      * enables secure POSTing to HTTP endpoint without warning from browser.
  194.      *
  195.      * For this to work, module.php/core/postredirect.php must be accessible
  196.      * also via HTTP on IdP, e.g. if your IdP is on
  197.      * https://idp.example.org/ssp/, then
  198.      * http://idp.example.org/ssp/module.php/core/postredirect.php must be accessible.
  199.      */
  200.     'enable.http_post' => false,
  201.  
  202.     /*
  203.      * Set the allowed clock skew between encrypting/decrypting assertions
  204.      *
  205.      * If you have an server that is constantly out of sync, this option
  206.      * allows you to adjust the allowed clock-skew.
  207.      *
  208.      * Allowed range: 180 - 300
  209.      * Defaults to 180.
  210.      */
  211.     'assertion.allowed_clock_skew' => 180,
  212.  
  213.  
  214.     /************************
  215.      | ERRORS AND DEBUGGING |
  216.      ************************/
  217.  
  218.     /*
  219.      * The 'debug' option allows you to control how SimpleSAMLphp behaves in certain
  220.      * situations where further action may be taken
  221.      *
  222.      * It can be left unset, in which case, debugging is switched off for all actions.
  223.      * If set, it MUST be an array containing the actions that you want to enable, or
  224.      * alternatively a hashed array where the keys are the actions and their
  225.      * corresponding values are booleans enabling or disabling each particular action.
  226.      *
  227.      * SimpleSAMLphp provides some pre-defined actions, though modules could add new
  228.      * actions here. Refer to the documentation of every module to learn if they
  229.      * allow you to set any more debugging actions.
  230.      *
  231.      * The pre-defined actions are:
  232.      *
  233.      * - 'saml': this action controls the logging of SAML messages exchanged with other
  234.      * entities. When enabled ('saml' is present in this option, or set to true), all
  235.      * SAML messages will be logged, including plaintext versions of encrypted
  236.      * messages.
  237.      *
  238.      * - 'backtraces': this action controls the logging of error backtraces so you
  239.      * can debug any possible errors happening in SimpleSAMLphp.
  240.      *
  241.      * - 'validatexml': this action allows you to validate SAML documents against all
  242.      * the relevant XML schemas. SAML 1.1 messages or SAML metadata parsed with
  243.      * the XML to SimpleSAMLphp metadata converter or the metaedit module will
  244.      * validate the SAML documents if this option is enabled.
  245.      *
  246.      * If you want to disable debugging completely, unset this option or set it to an
  247.      * empty array.
  248.      */
  249.     'debug' => [
  250.         'saml' => false,
  251.         'backtraces' => true,
  252.         'validatexml' => false,
  253.     ],
  254.  
  255.     /*
  256.      * When 'showerrors' is enabled, all error messages and stack traces will be output
  257.      * to the browser.
  258.      *
  259.      * When 'errorreporting' is enabled, a form will be presented for the user to report
  260.      * the error to 'technicalcontact_email'.
  261.      */
  262.     'showerrors' => true,
  263.     'errorreporting' => true,
  264.  
  265.     /*
  266.      * Custom error show function called from SimpleSAML\Error\Error::show.
  267.      * See docs/simplesamlphp-errorhandling.txt for function code example.
  268.      *
  269.      * Example:
  270.      *   'errors.show_function' => ['SimpleSAML\Module\example\Error', 'show'],
  271.      */
  272.  
  273.  
  274.  
  275.     /**************************
  276.      | LOGGING AND STATISTICS |
  277.      **************************/
  278.  
  279.     /*
  280.      * Define the minimum log level to log. Available levels:
  281.      * - SimpleSAML\Logger::ERR     No statistics, only errors
  282.      * - SimpleSAML\Logger::WARNING No statistics, only warnings/errors
  283.      * - SimpleSAML\Logger::NOTICE  Statistics and errors
  284.      * - SimpleSAML\Logger::INFO    Verbose logs
  285.      * - SimpleSAML\Logger::DEBUG   Full debug logs - not recommended for production
  286.      *
  287.      * Choose logging handler.
  288.      *
  289.      * Options: [syslog,file,errorlog,stderr]
  290.      *
  291.      */
  292.     'logging.level' => SimpleSAML\Logger::DEBUG,
  293.     'logging.handler' => 'file',
  294.  
  295.     /*
  296.      * Specify the format of the logs. Its use varies depending on the log handler used (for instance, you cannot
  297.      * control here how dates are displayed when using the syslog or errorlog handlers), but in general the options
  298.      * are:
  299.      *
  300.      * - %date{<format>}: the date and time, with its format specified inside the brackets. See the PHP documentation
  301.      *   of the strftime() function for more information on the format. If the brackets are omitted, the standard
  302.      *   format is applied. This can be useful if you just want to control the placement of the date, but don't care
  303.      *   about the format.
  304.      *
  305.      * - %process: the name of the SimpleSAMLphp process. Remember you can configure this in the 'logging.processname'
  306.      *   option below.
  307.      *
  308.      * - %level: the log level (name or number depending on the handler used).
  309.      *
  310.      * - %stat: if the log entry is intended for statistical purposes, it will print the string 'STAT ' (bear in mind
  311.      *   the trailing space).
  312.      *
  313.      * - %trackid: the track ID, an identifier that allows you to track a single session.
  314.      *
  315.      * - %srcip: the IP address of the client. If you are behind a proxy, make sure to modify the
  316.      *   $_SERVER['REMOTE_ADDR'] variable on your code accordingly to the X-Forwarded-For header.
  317.      *
  318.      * - %msg: the message to be logged.
  319.      *
  320.      */
  321.     //'logging.format' => '%date{%b %d %H:%M:%S} %process %level %stat[%trackid] %msg',
  322.  
  323.     /*
  324.      * Choose which facility should be used when logging with syslog.
  325.      *
  326.      * These can be used for filtering the syslog output from SimpleSAMLphp into its
  327.      * own file by configuring the syslog daemon.
  328.      *
  329.      * See the documentation for openlog (http://php.net/manual/en/function.openlog.php) for available
  330.      * facilities. Note that only LOG_USER is valid on windows.
  331.      *
  332.      * The default is to use LOG_LOCAL5 if available, and fall back to LOG_USER if not.
  333.      */
  334.     'logging.facility' => defined('LOG_LOCAL5') ? constant('LOG_LOCAL5') : LOG_USER,
  335.  
  336.     /*
  337.      * The process name that should be used when logging to syslog.
  338.      * The value is also written out by the other logging handlers.
  339.      */
  340.     'logging.processname' => 'simplesamlphp',
  341.  
  342.     /*
  343.      * Logging: file - Logfilename in the loggingdir from above.
  344.      */
  345.     'logging.logfile' => 'simplesamlphp.log',
  346.  
  347.     /*
  348.      * This is an array of outputs. Each output has at least a 'class' option, which
  349.      * selects the output.
  350.      */
  351.     'statistics.out' => [// Log statistics to the normal log.
  352.         /*
  353.         [
  354.             'class' => 'core:Log',
  355.             'level' => 'notice',
  356.         ],
  357.         */
  358.         // Log statistics to files in a directory. One file per day.
  359.         /*
  360.         [
  361.             'class' => 'core:File',
  362.             'directory' => '/var/log/stats',
  363.         ],
  364.         */
  365.     ],
  366.  
  367.  
  368.  
  369.     /***********************
  370.      | PROXY CONFIGURATION |
  371.      ***********************/
  372.  
  373.     /*
  374.      * Proxy to use for retrieving URLs.
  375.      *
  376.      * Example:
  377.      *   'proxy' => 'tcp://proxy.example.com:5100'
  378.      */
  379.     'proxy' => null,
  380.  
  381.     /*
  382.      * Username/password authentication to proxy (Proxy-Authorization: Basic)
  383.      * Example:
  384.      *   'proxy.auth' = 'myuser:password'
  385.      */
  386.     //'proxy.auth' => 'myuser:password',
  387.  
  388.  
  389.  
  390.     /**************************
  391.      | DATABASE CONFIGURATION |
  392.      **************************/
  393.  
  394.     /*
  395.      * This database configuration is optional. If you are not using
  396.      * core functionality or modules that require a database, you can
  397.      * skip this configuration.
  398.      */
  399.  
  400.     /*
  401.      * Database connection string.
  402.      * Ensure that you have the required PDO database driver installed
  403.      * for your connection string.
  404.      */
  405.     'database.dsn' => 'mysql:host=localhost;dbname=saml',
  406.  
  407.     /*
  408.      * SQL database credentials
  409.      */
  410.     'database.username' => 'simplesamlphp',
  411.     'database.password' => 'secret',
  412.     'database.options' => [],
  413.  
  414.     /*
  415.      * (Optional) Table prefix
  416.      */
  417.     'database.prefix' => '',
  418.  
  419.     /*
  420.      * (Optional) Driver options
  421.      */
  422.     'database.driver_options' => [],
  423.  
  424.     /*
  425.      * True or false if you would like a persistent database connection
  426.      */
  427.     'database.persistent' => false,
  428.  
  429.     /*
  430.      * Database slave configuration is optional as well. If you are only
  431.      * running a single database server, leave this blank. If you have
  432.      * a master/slave configuration, you can define as many slave servers
  433.      * as you want here. Slaves will be picked at random to be queried from.
  434.      *
  435.      * Configuration options in the slave array are exactly the same as the
  436.      * options for the master (shown above) with the exception of the table
  437.      * prefix and driver options.
  438.      */
  439.     'database.slaves' => [
  440.         /*
  441.         [
  442.             'dsn' => 'mysql:host=myslave;dbname=saml',
  443.             'username' => 'simplesamlphp',
  444.             'password' => 'secret',
  445.             'persistent' => false,
  446.         ],
  447.         */
  448.     ],
  449.  
  450.  
  451.  
  452.     /*************
  453.      | PROTOCOLS |
  454.      *************/
  455.  
  456.     /*
  457.      * Which functionality in SimpleSAMLphp do you want to enable. Normally you would enable only
  458.      * one of the functionalities below, but in some cases you could run multiple functionalities.
  459.      * In example when you are setting up a federation bridge.
  460.      *
  461.      * Note that shib13-idp has been deprecated and will be removed in SimpleSAMLphp 2.0.
  462.      */
  463.     'enable.saml20-idp' => true,
  464.     'enable.shib13-idp' => false,
  465.     'enable.adfs-idp' => false,
  466.  
  467.     /*
  468.      * Whether SimpleSAMLphp should sign the response or the assertion in SAML 1.1 authentication
  469.      * responses.
  470.      *
  471.      * The default is to sign the assertion element, but that can be overridden by setting this
  472.      * option to TRUE. It can also be overridden on a pr. SP basis by adding an option with the
  473.      * same name to the metadata of the SP.
  474.      */
  475.     'shib13.signresponse' => true,
  476.  
  477.  
  478.  
  479.     /***********
  480.      | MODULES |
  481.      ***********/
  482.  
  483.     /*
  484.      * Configuration to override module enabling/disabling.
  485.      *
  486.      * Example:
  487.      *
  488.      * 'module.enable' => [
  489.      *      'exampleauth' => true, // Setting to TRUE enables.
  490.      *      'consent' => false, // Setting to FALSE disables.
  491.      *      'core' => null, // Unset or NULL uses default.
  492.      * ],
  493.      *
  494.      */
  495.  
  496.      'module.enable' => [
  497.          'exampleauth' => true,
  498.          'core' => true,
  499.          'saml' => true
  500.      ],
  501.  
  502.  
  503.     /*************************
  504.      | SESSION CONFIGURATION |
  505.      *************************/
  506.  
  507.     /*
  508.      * This value is the duration of the session in seconds. Make sure that the time duration of
  509.      * cookies both at the SP and the IdP exceeds this duration.
  510.      */
  511.     'session.duration' => 8 * (60 * 60), // 8 hours.
  512.  
  513.     /*
  514.      * Sets the duration, in seconds, data should be stored in the datastore. As the data store is used for
  515.      * login and logout requests, this option will control the maximum time these operations can take.
  516.      * The default is 4 hours (4*60*60) seconds, which should be more than enough for these operations.
  517.      */
  518.     'session.datastore.timeout' => (4 * 60 * 60), // 4 hours
  519.  
  520.     /*
  521.      * Sets the duration, in seconds, auth state should be stored.
  522.      */
  523.     'session.state.timeout' => (60 * 60), // 1 hour
  524.  
  525.     /*
  526.      * Option to override the default settings for the session cookie name
  527.      */
  528.     'session.cookie.name' => 'SimpleSAMLSessionID',
  529.  
  530.     /*
  531.      * Expiration time for the session cookie, in seconds.
  532.      *
  533.      * Defaults to 0, which means that the cookie expires when the browser is closed.
  534.      *
  535.      * Example:
  536.      *  'session.cookie.lifetime' => 30*60,
  537.      */
  538.     'session.cookie.lifetime' => 0,
  539.  
  540.     /*
  541.      * Limit the path of the cookies.
  542.      *
  543.      * Can be used to limit the path of the cookies to a specific subdirectory.
  544.      *
  545.      * Example:
  546.      *  'session.cookie.path' => '/simplesaml/',
  547.      */
  548.     'session.cookie.path' => '/',
  549.  
  550.     /*
  551.      * Cookie domain.
  552.      *
  553.      * Can be used to make the session cookie available to several domains.
  554.      *
  555.      * Example:
  556.      *  'session.cookie.domain' => '.example.org',
  557.      */
  558.     'session.cookie.domain' => 'live.comprehensibleinputwiki.com',
  559.     'session.cookie.domain' => 'comprehensibleinputwiki.com',
  560.  
  561.  
  562.     /*
  563.      * Set the secure flag in the cookie.
  564.      *
  565.      * Set this to TRUE if the user only accesses your service
  566.      * through https. If the user can access the service through
  567.      * both http and https, this must be set to FALSE.
  568.      */
  569.     'session.cookie.secure' => true,
  570.  
  571.     /*
  572.      * Set the SameSite attribute in the cookie.
  573.      *
  574.      * You can set this to the strings 'None', 'Lax', or 'Strict' to support
  575.      * the RFC6265bis SameSite cookie attribute. If set to null, no SameSite
  576.      * attribute will be sent.
  577.      *
  578.      * A value of "None" is required to properly support cross-domain POST
  579.      * requests which are used by different SAML bindings. Because some older
  580.      * browsers do not support this value, the canSetSameSiteNone function
  581.      * can be called to only set it for compatible browsers.
  582.      *
  583.      * You must also set the 'session.cookie.secure' value above to true.
  584.      *
  585.      * Example:
  586.      *  'session.cookie.samesite' => 'None',
  587.      */
  588.     'session.cookie.samesite' => \SimpleSAML\Utils\HTTP::canSetSameSiteNone() ? 'None' : null,
  589.  
  590.     /*
  591.      * Options to override the default settings for php sessions.
  592.      */
  593.     'session.phpsession.cookiename' => 'SimpleSAML',
  594.     'session.phpsession.savepath' => null,
  595.     'session.phpsession.httponly' => true,
  596.  
  597.     /*
  598.      * Option to override the default settings for the auth token cookie
  599.      */
  600.     'session.authtoken.cookiename' => 'SimpleSAMLAuthToken',
  601.  
  602.     /*
  603.      * Options for remember me feature for IdP sessions. Remember me feature
  604.      * has to be also implemented in authentication source used.
  605.      *
  606.      * Option 'session.cookie.lifetime' should be set to zero (0), i.e. cookie
  607.      * expires on browser session if remember me is not checked.
  608.      *
  609.      * Session duration ('session.duration' option) should be set according to
  610.      * 'session.rememberme.lifetime' option.
  611.      *
  612.      * It's advised to use remember me feature with session checking function
  613.      * defined with 'session.check_function' option.
  614.      */
  615.     'session.rememberme.enable' => false,
  616.     'session.rememberme.checked' => false,
  617.     'session.rememberme.lifetime' => (14 * 86400),
  618.  
  619.     /*
  620.      * Custom function for session checking called on session init and loading.
  621.      * See docs/simplesamlphp-advancedfeatures.txt for function code example.
  622.      *
  623.      * Example:
  624.      *   'session.check_function' => ['\SimpleSAML\Module\example\Util', 'checkSession'],
  625.      */
  626.  
  627.  
  628.  
  629.     /**************************
  630.      | MEMCACHE CONFIGURATION |
  631.      **************************/
  632.  
  633.     /*
  634.      * Configuration for the 'memcache' session store. This allows you to store
  635.      * multiple redundant copies of sessions on different memcache servers.
  636.      *
  637.      * 'memcache_store.servers' is an array of server groups. Every data
  638.      * item will be mirrored in every server group.
  639.      *
  640.      * Each server group is an array of servers. The data items will be
  641.      * load-balanced between all servers in each server group.
  642.      *
  643.      * Each server is an array of parameters for the server. The following
  644.      * options are available:
  645.      *  - 'hostname': This is the hostname or ip address where the
  646.      *    memcache server runs. This is the only required option.
  647.      *  - 'port': This is the port number of the memcache server. If this
  648.      *    option isn't set, then we will use the 'memcache.default_port'
  649.      *    ini setting. This is 11211 by default.
  650.      *
  651.      * When using the "memcache" extension, the following options are also
  652.      * supported:
  653.      *  - 'weight': This sets the weight of this server in this server
  654.      *    group. http://php.net/manual/en/function.Memcache-addServer.php
  655.      *    contains more information about the weight option.
  656.      *  - 'timeout': The timeout for this server. By default, the timeout
  657.      *    is 3 seconds.
  658.      *
  659.      * Example of redundant configuration with load balancing:
  660.      * This configuration makes it possible to lose both servers in the
  661.      * a-group or both servers in the b-group without losing any sessions.
  662.      * Note that sessions will be lost if one server is lost from both the
  663.      * a-group and the b-group.
  664.      *
  665.      * 'memcache_store.servers' => [
  666.      *     [
  667.      *         ['hostname' => 'mc_a1'],
  668.      *         ['hostname' => 'mc_a2'],
  669.      *     ],
  670.      *     [
  671.      *         ['hostname' => 'mc_b1'],
  672.      *         ['hostname' => 'mc_b2'],
  673.      *     ],
  674.      * ],
  675.      *
  676.      * Example of simple configuration with only one memcache server,
  677.      * running on the same computer as the web server:
  678.      * Note that all sessions will be lost if the memcache server crashes.
  679.      *
  680.      * 'memcache_store.servers' => [
  681.      *     [
  682.      *         ['hostname' => 'localhost'],
  683.      *     ],
  684.      * ],
  685.      *
  686.      * Additionally, when using the "memcached" extension, unique keys must
  687.      * be provided for each group of servers if persistent connections are
  688.      * desired. Each server group can also have an "options" indexed array
  689.      * with the options desired for the given group:
  690.      *
  691.      * 'memcache_store.servers' => [
  692.      *     'memcache_group_1' => [
  693.      *         'options' => [
  694.      *              \Memcached::OPT_BINARY_PROTOCOL => true,
  695.      *              \Memcached::OPT_NO_BLOCK => true,
  696.      *              \Memcached::OPT_TCP_NODELAY => true,
  697.      *              \Memcached::OPT_LIBKETAMA_COMPATIBLE => true,
  698.      *         ],
  699.      *         ['hostname' => '127.0.0.1', 'port' => 11211],
  700.      *         ['hostname' => '127.0.0.2', 'port' => 11211],
  701.      *     ],
  702.      *
  703.      *     'memcache_group_2' => [
  704.      *         'options' => [
  705.      *              \Memcached::OPT_BINARY_PROTOCOL => true,
  706.      *              \Memcached::OPT_NO_BLOCK => true,
  707.      *              \Memcached::OPT_TCP_NODELAY => true,
  708.      *              \Memcached::OPT_LIBKETAMA_COMPATIBLE => true,
  709.      *         ],
  710.      *         ['hostname' => '127.0.0.3', 'port' => 11211],
  711.      *         ['hostname' => '127.0.0.4', 'port' => 11211],
  712.      *     ],
  713.      * ],
  714.      *
  715.      */
  716.     'memcache_store.servers' => [
  717.         [
  718.             ['hostname' => 'localhost'],
  719.         ],
  720.     ],
  721.  
  722.     /*
  723.      * This value allows you to set a prefix for memcache-keys. The default
  724.      * for this value is 'simpleSAMLphp', which is fine in most cases.
  725.      *
  726.      * When running multiple instances of SSP on the same host, and more
  727.      * than one instance is using memcache, you probably want to assign
  728.      * a unique value per instance to this setting to avoid data collision.
  729.      */
  730.     'memcache_store.prefix' => '',
  731.  
  732.     /*
  733.      * This value is the duration data should be stored in memcache. Data
  734.      * will be dropped from the memcache servers when this time expires.
  735.      * The time will be reset every time the data is written to the
  736.      * memcache servers.
  737.      *
  738.      * This value should always be larger than the 'session.duration'
  739.      * option. Not doing this may result in the session being deleted from
  740.      * the memcache servers while it is still in use.
  741.      *
  742.      * Set this value to 0 if you don't want data to expire.
  743.      *
  744.      * Note: The oldest data will always be deleted if the memcache server
  745.      * runs out of storage space.
  746.      */
  747.     'memcache_store.expires' => 36 * (60 * 60), // 36 hours.
  748.  
  749.  
  750.  
  751.     /*************************************
  752.      | LANGUAGE AND INTERNATIONALIZATION |
  753.      *************************************/
  754.  
  755.     /*
  756.      * Language-related options.
  757.      */
  758.     'language' => [
  759.         /*
  760.          * An array in the form 'language' => <list of alternative languages>.
  761.          *
  762.          * Each key in the array is the ISO 639 two-letter code for a language,
  763.          * and its value is an array with a list of alternative languages that
  764.          * can be used if the given language is not available at some point.
  765.          * Each alternative language is also specified by its ISO 639 code.
  766.          *
  767.          * For example, for the "no" language code (Norwegian), we would have:
  768.          *
  769.          * 'priorities' => [
  770.          *      'no' => ['nb', 'nn', 'en', 'se'],
  771.          *      ...
  772.          * ],
  773.          *
  774.          * establishing that if a translation for the "no" language code is
  775.          * not available, we look for translations in "nb",
  776.          * and so on, in that order.
  777.          */
  778.         'priorities' => [
  779.             'no' => ['nb', 'nn', 'en', 'se'],
  780.             'nb' => ['no', 'nn', 'en', 'se'],
  781.             'nn' => ['no', 'nb', 'en', 'se'],
  782.             'se' => ['nb', 'no', 'nn', 'en'],
  783.             'nr' => ['zu', 'en'],
  784.             'nd' => ['zu', 'en'],
  785.             'tw' => ['st', 'en'],
  786.             'nso' => ['st', 'en'],
  787.         ],
  788.     ],
  789.  
  790.     /*
  791.      * Languages available, RTL languages, and what language is the default.
  792.      */
  793.     'language.available' => [
  794.         'en', 'no', 'nn', 'se', 'da', 'de', 'sv', 'fi', 'es', 'ca', 'fr', 'it', 'nl', 'lb',
  795.         'cs', 'sl', 'lt', 'hr', 'hu', 'pl', 'pt', 'pt-br', 'tr', 'ja', 'zh', 'zh-tw', 'ru',
  796.         'et', 'he', 'id', 'sr', 'lv', 'ro', 'eu', 'el', 'af', 'zu', 'xh', 'st',
  797.     ],
  798.     'language.rtl' => ['ar', 'dv', 'fa', 'ur', 'he'],
  799.     'language.default' => 'en',
  800.  
  801.     /*
  802.      * Options to override the default settings for the language parameter
  803.      */
  804.     'language.parameter.name' => 'language',
  805.     'language.parameter.setcookie' => true,
  806.  
  807.     /*
  808.      * Options to override the default settings for the language cookie
  809.      */
  810.     'language.cookie.name' => 'language',
  811.     'language.cookie.domain' => null,
  812.     'language.cookie.path' => '/',
  813.     'language.cookie.secure' => true,
  814.     'language.cookie.httponly' => false,
  815.     'language.cookie.lifetime' => (60 * 60 * 24 * 900),
  816.     'language.cookie.samesite' => \SimpleSAML\Utils\HTTP::canSetSameSiteNone() ? 'None' : null,
  817.  
  818.     /**
  819.      * Custom getLanguage function called from SimpleSAML\Locale\Language::getLanguage().
  820.      * Function should return language code of one of the available languages or NULL.
  821.      * See SimpleSAML\Locale\Language::getLanguage() source code for more info.
  822.      *
  823.      * This option can be used to implement a custom function for determining
  824.      * the default language for the user.
  825.      *
  826.      * Example:
  827.      *   'language.get_language_function' => ['\SimpleSAML\Module\example\Template', 'getLanguage'],
  828.      */
  829.  
  830.     /*
  831.      * Extra dictionary for attribute names.
  832.      * This can be used to define local attributes.
  833.      *
  834.      * The format of the parameter is a string with <module>:<dictionary>.
  835.      *
  836.      * Specifying this option will cause us to look for modules/<module>/dictionaries/<dictionary>.definition.json
  837.      * The dictionary should look something like:
  838.      *
  839.      * {
  840.      *     "firstattribute": {
  841.      *         "en": "English name",
  842.      *         "no": "Norwegian name"
  843.      *     },
  844.      *     "secondattribute": {
  845.      *         "en": "English name",
  846.      *         "no": "Norwegian name"
  847.      *     }
  848.      * }
  849.      *
  850.      * Note that all attribute names in the dictionary must in lowercase.
  851.      *
  852.      * Example: 'attributes.extradictionary' => 'ourmodule:ourattributes',
  853.      */
  854.     'attributes.extradictionary' => null,
  855.  
  856.  
  857.  
  858.     /**************
  859.      | APPEARANCE |
  860.      **************/
  861.  
  862.     /*
  863.      * Which theme directory should be used?
  864.      */
  865.     'theme.use' => 'default',
  866.  
  867.     /*
  868.      * Set this option to the text you would like to appear at the header of each page. Set to false if you don't want
  869.      * any text to appear in the header.
  870.      */
  871.     //'theme.header' => 'SimpleSAMLphp'
  872.  
  873.     /**
  874.      * A template controller, if any.
  875.      *
  876.      * Used to intercept certain parts of the template handling, while keeping away unwanted/unexpected hooks. Set
  877.      * the 'theme.controller' configuration option to a class that implements the
  878.      * \SimpleSAML\XHTML\TemplateControllerInterface interface to use it.
  879.      */
  880.     //'theme.controller' => '',
  881.  
  882.     /*
  883.      * Templating options
  884.      *
  885.      * By default, twig templates are not cached. To turn on template caching:
  886.      * Set 'template.cache' to an absolute path pointing to a directory that
  887.      * SimpleSAMLphp has read and write permissions to.
  888.      */
  889.     //'template.cache' => '',
  890.  
  891.     /*
  892.      * Set the 'template.auto_reload' to true if you would like SimpleSAMLphp to
  893.      * recompile the templates (when using the template cache) if the templates
  894.      * change. If you don't want to check the source templates for every request,
  895.      * set it to false.
  896.      */
  897.     'template.auto_reload' => false,
  898.  
  899.     /*
  900.      * Set this option to true to indicate that your installation of SimpleSAMLphp
  901.      * is running in a production environment. This will affect the way resources
  902.      * are used, offering an optimized version when running in production, and an
  903.      * easy-to-debug one when not. Set it to false when you are testing or
  904.      * developing the software, in which case a banner will be displayed to remind
  905.      * users that they're dealing with a non-production instance.
  906.      *
  907.      * Defaults to true.
  908.      */
  909.     'production' => true,
  910.  
  911.     /*
  912.      * SimpleSAMLphp modules can host static resources which are served through PHP.
  913.      * The serving of the resources can be configured through these settings.
  914.      */
  915.     'assets' => [
  916.         /*
  917.          * These settings adjust the caching headers that are sent
  918.          * when serving static resources.
  919.          */
  920.         'caching' => [
  921.             /*
  922.              * Amount of seconds before the resource should be fetched again
  923.              */
  924.             'max_age' => 86400,
  925.             /*
  926.              * Calculate a checksum of every file and send it to the browser
  927.              * This allows the browser to avoid downloading assets again in situations
  928.              * where the Last-Modified header cannot be trusted,
  929.              * for example in cluster setups
  930.              *
  931.              * Defaults false
  932.              */
  933.             'etag' => false,
  934.         ],
  935.     ],
  936.  
  937.  
  938.     /*********************
  939.      | DISCOVERY SERVICE |
  940.      *********************/
  941.  
  942.     /*
  943.      * Whether the discovery service should allow the user to save his choice of IdP.
  944.      */
  945.     'idpdisco.enableremember' => true,
  946.     'idpdisco.rememberchecked' => true,
  947.  
  948.     /*
  949.      * The disco service only accepts entities it knows.
  950.      */
  951.     'idpdisco.validate' => true,
  952.  
  953.     'idpdisco.extDiscoveryStorage' => null,
  954.  
  955.     /*
  956.      * IdP Discovery service look configuration.
  957.      * Wether to display a list of idp or to display a dropdown box. For many IdP' a dropdown box
  958.      * gives the best use experience.
  959.      *
  960.      * When using dropdown box a cookie is used to highlight the previously chosen IdP in the dropdown.
  961.      * This makes it easier for the user to choose the IdP
  962.      *
  963.      * Options: [links,dropdown]
  964.      */
  965.     'idpdisco.layout' => 'dropdown',
  966.  
  967.  
  968.  
  969.     /*************************************
  970.      | AUTHENTICATION PROCESSING FILTERS |
  971.      *************************************/
  972.  
  973.     /*
  974.      * Authentication processing filters that will be executed for all IdPs
  975.      * Both Shibboleth and SAML 2.0
  976.      */
  977.     'authproc.idp' => [
  978.         /* Enable the authproc filter below to add URN prefixes to all attributes
  979.         10 => array[
  980.             'class' => 'core:AttributeMap', 'addurnprefix'
  981.         ],
  982.         */
  983.         /* Enable the authproc filter below to automatically generated eduPersonTargetedID.
  984.         20 => 'core:TargetedID',
  985.         */
  986.  
  987.         // Adopts language from attribute to use in UI
  988.         30 => 'core:LanguageAdaptor',
  989.  
  990.         45 => [
  991.             'class'         => 'core:StatisticsWithAttribute',
  992.             'attributename' => 'realm',
  993.             'type'          => 'saml20-idp-SSO',
  994.         ],
  995.  
  996.         /* When called without parameters, it will fallback to filter attributes 'the old way'
  997.          * by checking the 'attributes' parameter in metadata on IdP hosted and SP remote.
  998.          */
  999.         50 => 'core:AttributeLimit',
  1000.  
  1001.         /*
  1002.          * Search attribute "distinguishedName" for pattern and replaces if found
  1003.          */
  1004.         /*
  1005.         60 => [
  1006.             'class' => 'core:AttributeAlter',
  1007.             'pattern' => '/OU=studerende/',
  1008.             'replacement' => 'Student',
  1009.             'subject' => 'distinguishedName',
  1010.             '%replace',
  1011.         ],
  1012.         */
  1013.  
  1014.         /*
  1015.          * Consent module is enabled (with no permanent storage, using cookies).
  1016.          */
  1017.         /*
  1018.         90 => [
  1019.             'class' => 'consent:Consent',
  1020.             'store' => 'consent:Cookie',
  1021.             'focus' => 'yes',
  1022.             'checked' => true
  1023.         ],
  1024.         */
  1025.         // If language is set in Consent module it will be added as an attribute.
  1026.         99 => 'core:LanguageAdaptor',
  1027.     ],
  1028.  
  1029.     /*
  1030.      * Authentication processing filters that will be executed for all SPs
  1031.      * Both Shibboleth and SAML 2.0
  1032.      */
  1033.     'authproc.sp' => [
  1034.         /*
  1035.         10 => [
  1036.             'class' => 'core:AttributeMap', 'removeurnprefix'
  1037.         ],
  1038.         */
  1039.  
  1040.         /*
  1041.          * Generate the 'group' attribute populated from other variables, including eduPersonAffiliation.
  1042.         60 => [
  1043.             'class' => 'core:GenerateGroups', 'eduPersonAffiliation'
  1044.         ],
  1045.         */
  1046.         /*
  1047.          * All users will be members of 'users' and 'members'
  1048.          */
  1049.         /*
  1050.         61 => [
  1051.             'class' => 'core:AttributeAdd', 'groups' => ['users', 'members']
  1052.         ],
  1053.         */
  1054.  
  1055.         // Adopts language from attribute to use in UI
  1056.         90 => 'core:LanguageAdaptor',
  1057.     ],
  1058.  
  1059.  
  1060.  
  1061.     /**************************
  1062.      | METADATA CONFIGURATION |
  1063.      **************************/
  1064.  
  1065.     /*
  1066.      * This option allows you to specify a directory for your metadata outside of the standard metadata directory
  1067.      * included in the standard distribution of the software.
  1068.      */
  1069.     'metadatadir' => 'metadata',
  1070.  
  1071.     /*
  1072.      * This option configures the metadata sources. The metadata sources is given as an array with
  1073.      * different metadata sources. When searching for metadata, SimpleSAMLphp will search through
  1074.      * the array from start to end.
  1075.      *
  1076.      * Each element in the array is an associative array which configures the metadata source.
  1077.      * The type of the metadata source is given by the 'type' element. For each type we have
  1078.      * different configuration options.
  1079.      *
  1080.      * Flat file metadata handler:
  1081.      * - 'type': This is always 'flatfile'.
  1082.      * - 'directory': The directory we will load the metadata files from. The default value for
  1083.      *                this option is the value of the 'metadatadir' configuration option, or
  1084.      *                'metadata/' if that option is unset.
  1085.      *
  1086.      * XML metadata handler:
  1087.      * This metadata handler parses an XML file with either an EntityDescriptor element or an
  1088.      * EntitiesDescriptor element. The XML file may be stored locally, or (for debugging) on a remote
  1089.      * web server.
  1090.      * The XML metadata handler defines the following options:
  1091.      * - 'type': This is always 'xml'.
  1092.      * - 'file': Path to the XML file with the metadata.
  1093.      * - 'url': The URL to fetch metadata from. THIS IS ONLY FOR DEBUGGING - THERE IS NO CACHING OF THE RESPONSE.
  1094.      *
  1095.      * MDQ metadata handler:
  1096.      * This metadata handler looks up for the metadata of an entity at the given MDQ server.
  1097.      * The MDQ metadata handler defines the following options:
  1098.      * - 'type': This is always 'mdq'.
  1099.      * - 'server': Base URL of the MDQ server. Mandatory.
  1100.      * - 'validateFingerprint': The fingerprint of the certificate used to sign the metadata. You don't need this
  1101.      *                          option if you don't want to validate the signature on the metadata. Optional.
  1102.      * - 'cachedir': Directory where metadata can be cached. Optional.
  1103.      * - 'cachelength': Maximum time metadata can be cached, in seconds. Defaults to 24
  1104.      *                  hours (86400 seconds). Optional.
  1105.      *
  1106.      * PDO metadata handler:
  1107.      * This metadata handler looks up metadata of an entity stored in a database.
  1108.      *
  1109.      * Note: If you are using the PDO metadata handler, you must configure the database
  1110.      * options in this configuration file.
  1111.      *
  1112.      * The PDO metadata handler defines the following options:
  1113.      * - 'type': This is always 'pdo'.
  1114.      *
  1115.      * Examples:
  1116.      *
  1117.      * This example defines two flatfile sources. One is the default metadata directory, the other
  1118.      * is a metadata directory with auto-generated metadata files.
  1119.      *
  1120.      * 'metadata.sources' => [
  1121.      *     ['type' => 'flatfile'],
  1122.      *     ['type' => 'flatfile', 'directory' => 'metadata-generated'],
  1123.      * ],
  1124.      *
  1125.      * This example defines a flatfile source and an XML source.
  1126.      * 'metadata.sources' => [
  1127.      *     ['type' => 'flatfile'],
  1128.      *     ['type' => 'xml', 'file' => 'idp.example.org-idpMeta.xml'],
  1129.      * ],
  1130.      *
  1131.      * This example defines an mdq source.
  1132.      * 'metadata.sources' => [
  1133.      *      [
  1134.      *          'type' => 'mdq',
  1135.      *          'server' => 'http://mdq.server.com:8080',
  1136.      *          'cachedir' => '/var/simplesamlphp/mdq-cache',
  1137.      *          'cachelength' => 86400
  1138.      *      ]
  1139.      * ],
  1140.      *
  1141.      * This example defines an pdo source.
  1142.      * 'metadata.sources' => [
  1143.      *     ['type' => 'pdo']
  1144.      * ],
  1145.      *
  1146.      * Default:
  1147.      * 'metadata.sources' => [
  1148.      *     ['type' => 'flatfile']
  1149.      * ],
  1150.      */
  1151.     'metadata.sources' => [
  1152.         ['type' => 'flatfile'],
  1153.     ],
  1154.  
  1155.     /*
  1156.      * Should signing of generated metadata be enabled by default.
  1157.      *
  1158.      * Metadata signing can also be enabled for a individual SP or IdP by setting the
  1159.      * same option in the metadata for the SP or IdP.
  1160.      */
  1161.     'metadata.sign.enable' => false,
  1162.  
  1163.     /*
  1164.      * The default key & certificate which should be used to sign generated metadata. These
  1165.      * are files stored in the cert dir.
  1166.      * These values can be overridden by the options with the same names in the SP or
  1167.      * IdP metadata.
  1168.      *
  1169.      * If these aren't specified here or in the metadata for the SP or IdP, then
  1170.      * the 'certificate' and 'privatekey' option in the metadata will be used.
  1171.      * if those aren't set, signing of metadata will fail.
  1172.      */
  1173.     'metadata.sign.privatekey' => null,
  1174.     'metadata.sign.privatekey_pass' => null,
  1175.     'metadata.sign.certificate' => null,
  1176.  
  1177.  
  1178.     /****************************
  1179.      | DATA STORE CONFIGURATION |
  1180.      ****************************/
  1181.  
  1182.     /*
  1183.      * Configure the data store for SimpleSAMLphp.
  1184.      *
  1185.      * - 'phpsession': Limited datastore, which uses the PHP session.
  1186.      * - 'memcache': Key-value datastore, based on memcache.
  1187.      * - 'sql': SQL datastore, using PDO.
  1188.      * - 'redis': Key-value datastore, based on redis.
  1189.      *
  1190.      * The default datastore is 'phpsession'.
  1191.      */
  1192.     'store.type'                    => 'sql',
  1193.  
  1194.     /*
  1195.      * The DSN the sql datastore should connect to.
  1196.      *
  1197.      * See http://www.php.net/manual/en/pdo.drivers.php for the various
  1198.      * syntaxes.
  1199.      */
  1200.     'store.sql.dsn'                 => 'mysql:host=localhost;dbname=simplesamlphp',
  1201.  
  1202.     /*
  1203.      * The username and password to use when connecting to the database.
  1204.      */
  1205.     'store.sql.username' => 'simplesamlphp',
  1206.     'store.sql.password' => '***************',
  1207.  
  1208.     /*
  1209.      * The prefix we should use on our tables.
  1210.      */
  1211.     'store.sql.prefix' => 'SimpleSAMLphp',
  1212.  
  1213.     /*
  1214.      * The hostname and port of the Redis datastore instance.
  1215.      */
  1216.     'store.redis.host' => 'localhost',
  1217.     'store.redis.port' => 6379,
  1218.  
  1219.     /*
  1220.      * The prefix we should use on our Redis datastore.
  1221.      */
  1222.     'store.redis.prefix' => 'SimpleSAMLphp',
  1223. ];
  1224.  
Advertisement
Add Comment
Please, Sign In to add comment