DOC.md 21.2 KB
Newer Older
Lukas Haemmerle's avatar
Lukas Haemmerle committed
1
Copyright (c) 2018, SWITCH
Lukas Haemmerle's avatar
Lukas Haemmerle committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
See LICENSE file for details.

-------------------------------------------------------------------------------

SWITCHwayf Documentation
========================

Find below the documentation and configuration options for the SWITCHwayf.

-------------------------------------------------------------------------------

**This document is written in the markdown syntax**

-------------------------------------------------------------------------------

Description
-----------
19
The SWITCHwayf is an implementation of the Shibboleth WAYF and SAML2 Discovery
Lukas Haemmerle's avatar
Lukas Haemmerle committed
20 21 22 23
Service protocol for use withing a Shibboleth architecture.

Some of the Features:

24
- Supports Discovery Service and the Shibboleth authentication request protocol
Lukas Haemmerle's avatar
Lukas Haemmerle committed
25 26 27 28
- Supports processing SAML2 metadata files
- The central Discovery Service also works without Java Script
- Search-as-you type or selection from a list of organisations
- Various customizations options for header, footer, language strings etc.
29
- I18N support, currently language packs for en, de, it, fr and some other
Lukas Haemmerle's avatar
Lukas Haemmerle committed
30 31
  languages are included
- HTML code generation for embedding the WAYF directly into a web page
32
- Support for remembering IdP selection accross different services (when
Lukas Haemmerle's avatar
Lukas Haemmerle committed
33 34
  Embedded WAYF is used)
- Preselecting entry in drop down list by
35 36 37
  - SAML common domain cookie that contains selected Identity Providers
  - resource path info hint (e.g.
    /WAYF/unige.ch?shire=https://... selects University  of Geneva, depends
Lukas Haemmerle's avatar
Lukas Haemmerle committed
38 39 40 41 42 43 44 45 46 47
    of course on the ID scheme a federation uses)
  - Kerberos preselection
  - IP range preselection
  - IP reverse DNS lookup preselection
- Transparent redirection mode, e.g. /WAYF/unige.ch/redirect?shire=https://...

-------------------------------------------------------------------------------

Customization Options
---------------------
48 49 50
Since version 1.12 any graphical aspects can be customized such that these
changes normally should survive bug-fix and minor version upgrades.
Files whose names start with 'default-' can be copied and renamed to start with
Lukas Haemmerle's avatar
Lukas Haemmerle committed
51 52 53 54
'custom-' in order to  customize the file's behaviour.

In particular, the following customizations can be applied:

Lukas Haemmerle's avatar
Lukas Haemmerle committed
55
* HTML Header:   `custom-header.php`
Lukas Haemmerle's avatar
Lukas Haemmerle committed
56 57
  Customize page header

Lukas Haemmerle's avatar
Lukas Haemmerle committed
58 59
* HTML Footer:   `custom-footer.php`
  Customize page footer
Lukas Haemmerle's avatar
Lukas Haemmerle committed
60

Lukas Haemmerle's avatar
Lukas Haemmerle committed
61
* HTML Body:     `custom-body.php`
Lukas Haemmerle's avatar
Lukas Haemmerle committed
62 63
  Customize WAYF/DS body

Lukas Haemmerle's avatar
Lukas Haemmerle committed
64
* HTML Body:     `custom-settings.php`
Lukas Haemmerle's avatar
Lukas Haemmerle committed
65 66
  Customize WAYF/DS permanent settings body

Lukas Haemmerle's avatar
Lukas Haemmerle committed
67
* HTML Body:     `custom-notice.php`
Lukas Haemmerle's avatar
Lukas Haemmerle committed
68 69
  Customize WAYF/DS permanent settings notice body

Lukas Haemmerle's avatar
Lukas Haemmerle committed
70
* HTML Body:     `custom-embedded-wayf.php`
Lukas Haemmerle's avatar
Lukas Haemmerle committed
71 72
  Customize WAYF/DS body

Lukas Haemmerle's avatar
Lukas Haemmerle committed
73
* HTML Error:    `custom-error.php`
Lukas Haemmerle's avatar
Lukas Haemmerle committed
74 75
  Customize error messages

Lukas Haemmerle's avatar
Lukas Haemmerle committed
76
* CSS Main Style:    `css/custom-styles.css`
Lukas Haemmerle's avatar
Lukas Haemmerle committed
77 78 79
  Customize CSS styles that are loaded in addition to the default-styles.css.
  Therefore, they can be used to overwrite the default CSS styles.

Lukas Haemmerle's avatar
Lukas Haemmerle committed
80
* CSS Improved Drop Down Style:    `css/custom-ImprovedDropDown.css`
Lukas Haemmerle's avatar
Lukas Haemmerle committed
81 82 83 84
  Customize CSS styles to alter the appearance of the improved drop-down list,
  both for the stand-alone WAYF as well as the Embedded WAYF. The styles are
  loaded in addition to the default-ImprovedDropDown.css.

Lukas Haemmerle's avatar
Lukas Haemmerle committed
85
* Languages:     `custom-languages.php`
86 87
  Can be used to change default or add new language strings. The custom
  languages strings in addition to the default styles. Therefore, they can be
Lukas Haemmerle's avatar
Lukas Haemmerle committed
88
  used to overwrite the default CSS styles.
Lukas Haemmerle's avatar
Lukas Haemmerle committed
89 90 91 92 93 94 95 96 97 98 99 100 101 102
  This file can also be used to white or black list certain languages by
  adding to the end of the file:
  
        // Example to black list Japanase and Portuguese
        unset($langStrings['ja']);
        unset($langStrings['pt']);
  
        // Example to white list English, Italian, French and German
        foreach($langStrings as $lang => $strings){
          if ($lang != 'en' && $lang != 'it' && $lang != 'fr' && $lang != 'de'){
            unset($langStrings[$lang]);
          }
        }

Lukas Haemmerle's avatar
Lukas Haemmerle committed
103

104
If a custom file doesn't exist yet, the default templates and settings
Lukas Haemmerle's avatar
Lukas Haemmerle committed
105 106 107 108
are used. To create a custom template, copy the default files with:

`cp default-{$template}.php custom-{$template}.php`

109
where {$template} stands for the file you want to customize. Unless otherwise
Lukas Haemmerle's avatar
Lukas Haemmerle committed
110 111 112 113 114 115 116 117 118 119 120 121
mentioned the custom files replace the default files completely. Please read the
above information for each custom file.

-------------------------------------------------------------------------------

Logging
-------

The SWITCHwayf currently uses two types of logs:

* General Log
  Whenever a warning or an error message is thrown, this goes
122
  to the system log file. Errors occur when for example files
Lukas Haemmerle's avatar
Lukas Haemmerle committed
123 124 125 126 127 128 129 130 131 132 133
  cannot be read or written due to permission problems.

* Audit Log
  This is file-based logging. Whenever a user is redirected
  to an Identity Provider, a new entry is added to the file
  $WAYFLogFile which typically is in the same directory as
  the web server access log files (because it's the web server
  that writes to this file)


On the Audit log:
134 135 136
If the configuration option $useLogging is true, an audit log
file will be written to the path specified in $WAYFLogFile.
This log file is an audit log file where each line is an entry
Lukas Haemmerle's avatar
Lukas Haemmerle committed
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
of the form:

{DATE} {TIME} {IP} {IDP-SELECTION} {REQUEST-TYPE} {IDP-ENTITYID} {FORWARDING-URL}

Log entries are only created if the user was forwarded to an Identity Provider.

- {DATE}             = Date of request, e.g. 2010-11-02
- {TIME}             = Time of request, e.g. 06:25:13
- {IP}               = IP of requester, e.g. 127.0.0.1
- {IDP-SELECTION}    = How the IdP was selected: Cookie or Request
- {REQUEST-TYPE}     = Type of request: DS, WAYF, Embedded-DS, Embedded-WAYF
- {IDP-ENTITYID}     = EntityID of the IdP the user was forwarded to.
- {FORWARDING-URL}   = URL the user was redirected to
- {SP-ENTITYID}      = EntityID of the SP the user was coming from.

-------------------------------------------------------------------------------

Optimizations
-------------

157 158
If an instance of the SWITCHwayf has to deal with many requests and the load
is becoming  higher and higher, one should consider using a PHP opcode
Lukas Haemmerle's avatar
Lukas Haemmerle committed
159 160
cacher like XCache, apc,  eaccelerator, phpa, truck-mmcache or similar.

161 162 163
Using such a tool can decrease the processing time of the PHP code almost by
half. However, own tests have shown that the bottleneck in general is not
the PHP processing but the TLS handshake, which has nothing to do with PHP
Lukas Haemmerle's avatar
Lukas Haemmerle committed
164 165 166
or the SWITCHwayf itself. Still, the more entities (Identity Providers and
Service Provider) and instance consumes, the higher the processing speed gain.

167 168 169 170 171
Benchmark tests conducted by SWITCH demonstrated that generating the
Javascript WAYF/embedded-wayf.js can be speed up using APC or XCache
considerably (> 15%) if the  script is accessed via HTTP (without TLS).
However, if the script is accessed via HTTPS, the overall speed gain by using
an opcode cacher is much less because the TLS hand-shake is what
Lukas Haemmerle's avatar
Lukas Haemmerle committed
172 173 174 175 176 177 178 179 180 181 182 183 184
needs most time.

-------------------------------------------------------------------------------

SAML2 Metadata support
----------------------

In case the WAYF/DS should display the list of IdPs by parsing them from a
SAML2 Medatadata file that is used by Shibboleth:

- Set $useSAML2Metadata in config.php to true
- Specify the path to the metadata file that should be read in $metadataFile
  and make sure this file is updated regularely by Shibboleth or a cron job
185 186
- Make sure the files specified in $metadataIDPFile and $metadataSPFile can be
  written by the userthat executes the PHP script (the web server user,
Lukas Haemmerle's avatar
Lukas Haemmerle committed
187 188
  e.g. www-data or _www)

189
The parsed IDP and SP entries will be stored in $metadataIDPFile and
Lukas Haemmerle's avatar
Lukas Haemmerle committed
190 191 192
$metadataSPFile as executable PHP code, thus benefiting from opcode caching
(see chapter "Optimization" above).

193 194 195
If an entry should changed, removed or extended in this automatically
generated file, one can extend the IDP definitions by modifying them in
the $IDPConfigFile. To overwrite IDP values with entries in the $IDPConfigFile,
Lukas Haemmerle's avatar
Lukas Haemmerle committed
196 197 198 199
make sure the entry $SAML2MetaOverLocalConf is set to 'false';
For example one could change the displayed name of an IdP by adding an entry in
the file $IDPConfigFile like:

200
    $IDProviders["https://sso.example.org/idp/shibboleth"]["Name"] = "Foobar";
Lukas Haemmerle's avatar
Lukas Haemmerle committed
201

202
If an entry is in the SAML metadata file but should not be shown in the drop
Lukas Haemmerle's avatar
Lukas Haemmerle committed
203 204
down list, it can be hidden/removed with:

205
    $IDProviders["https://sso.example.org/idp/shibboleth"] = '';
Lukas Haemmerle's avatar
Lukas Haemmerle committed
206

207
To force a periodic refresh of the IdP, run readMetadata.php in command line
Lukas Haemmerle's avatar
Lukas Haemmerle committed
208 209
mode, i.e. by executing a cron script like:

210
    5 * * * * /usr/bin/php readMetadata.php > /dev/null
Lukas Haemmerle's avatar
Lukas Haemmerle committed
211 212 213 214 215 216

-------------------------------------------------------------------------------

Embedded WAYF support
---------------------

217 218
With the embedded WAYF support administrators of a Shibboleth protected
application can easily integrate a Discovery Service on the any page of their
Lukas Haemmerle's avatar
Lukas Haemmerle committed
219 220 221 222 223 224
application just by copying and adapting the HTML code snippet generated by the
SWITCHwayf via the URL /WAYF/embedded-wayf.js/snippet.html

The embedded WAYF then will display on the remote site a drop-down list with the
Identity Provider to authenticate.

225 226 227
One can also configure the embedded WAYF to hide or add Identity Providers
(even from remote federations) or adapt the look and feel of the embedded wayf.
This can be done by simpling modifying the JavaScript variables in the HTML
Lukas Haemmerle's avatar
Lukas Haemmerle committed
228 229 230 231
snippet.


**Note**
232 233 234 235 236
When activating the Embedded WAYF, carefully protect the host where the WAYF is
operated on. If an instance of SWITCHwayf gets compromised, an attacker could
modify the JavaScript that is embedded on the remote site in a malicous wayf
(e.g. phish the user's password, redirect users to malicous pages, steal their
sessions etc). One should also ensure that a centrally operated WAYF has a very
Lukas Haemmerle's avatar
Lukas Haemmerle committed
237 238
high availability because many services will depend on it.

239 240
Also, please be aware that using the Embedded WAYF allows anybody to guess a
user's Home Organisation without much effort. This information then could be
Lukas Haemmerle's avatar
Lukas Haemmerle committed
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
used for phising attacks for example!

Example Embedded WAYF Usage:

* https://toolbox.switch.ch/
* https://aai-viewer.switch.ch/
* https://www.olat.uzh.ch/
* https://ilias.unibe.ch/
* https://sympa.unil.ch/

-------------------------------------------------------------------------------

How to use the Embedded WAYF?
-----------------------------

256
1. Find a web page where a Discovery Service in form of the Embedded WAYF
Lukas Haemmerle's avatar
Lukas Haemmerle committed
257
   can be placed. This page of course may not enforce a Shibboleth session.
258 259 260 261 262 263 264

2. Get a sample HTML snippet to embed on the page. To get the snippet access the
   WAYF with this URL:
   https://{HOSTNAME}/{PATH-TO-WAYF}/WAYF/embedded-wayf.js/snippet.html
   The script should return HTML code that consists of a configuration
   JavaScript, a JavaScript loaded from the
   https://{HOSTNAME}/{PATH-TO-WAYF}/WAYF/embedded-wayf.js and a
Lukas Haemmerle's avatar
Lukas Haemmerle committed
265 266
   NoScript element for cases where a user has JavaScript not enabled.

267
3. Adapt at minimum all the 'ESSENTIAL SETTINGS' at the top of the snippet and
Lukas Haemmerle's avatar
Lukas Haemmerle committed
268
   the URL in the NoScript element.
269
   Optionally also adapt the recommended and advanced settings.
Lukas Haemmerle's avatar
Lukas Haemmerle committed
270 271 272
   Optionally remove all commented-out/obsolete settings of the configuration
   JavaScript.

273
4. Insert the edited snippet anywhere in the body of a page outside any HTML
Lukas Haemmerle's avatar
Lukas Haemmerle committed
274 275
   'form' element.

276
5. Save the page and then access it with your web browser to check whether it
Lukas Haemmerle's avatar
Lukas Haemmerle committed
277 278 279 280 281 282
   works. Also try logging in with JavaScript disabled.

Embedded WAYF code limitations:
* The Embedded WAYF won't work if placed within an HTML form element.
* If the embedded WAYF is placed on the right side or at the bottom of a web page,
  it may be that the web browser cannot expand and render the complete drop-down
283
  list of Identity Providers. Turning on the wayf_use_improved_drop_down_list
Lukas Haemmerle's avatar
Lukas Haemmerle committed
284 285
  setting might be a solution in this case.
* If placed on a host where no Service Provider is installed, the Embedded WAYF
286 287
  might not be able to detect whether a user is logged in or not. Also, the
  wayf_use_disco_feed might not be used.
Lukas Haemmerle's avatar
Lukas Haemmerle committed
288 289 290 291 292 293

-------------------------------------------------------------------------------

Kerberos support
----------------

294
If this features is used, the web server needs to support Negotiate/SPNEGO
Lukas Haemmerle's avatar
Lukas Haemmerle committed
295 296
Kerberos protocol. For example by using mod_auth_kerb.

297
1. Make a symlink of the file 'WAYF' and name it like configured in the variable
Lukas Haemmerle's avatar
Lukas Haemmerle committed
298 299 300 301
   $kerberosRedirectURL

2. Protect file $kerberosRedirectURL with Kerberos. The Kerberos realm must be
   specified in "IDProvider.conf.php" for each IdP. Each IdP's KDC must also
302 303
   establish a Kerberos cross-realm trust with the WAYF's KDC. This was tested
   with a Windows 2000 KDC, with the WAYF running on RHEL4.
Lukas Haemmerle's avatar
Lukas Haemmerle committed
304 305 306 307 308 309

-------------------------------------------------------------------------------

Configuration file format
-------------------------

310 311 312 313
Have a look at the file 'IDProvider.conf.php' for an example of the file format
that is used to configure the list of Identity Provider to display. It's
supposed to be mostly self-explanatory. Basically the file format is PHP code
that defines an array of arrays called $IDProviders.
Lukas Haemmerle's avatar
Lukas Haemmerle committed
314

315 316
The keys of the array $IDProviders must correspond to the entityIDs of the
Identity Providers or a unique value in case of a cascaded WAYF/DS or
Lukas Haemmerle's avatar
Lukas Haemmerle committed
317 318 319
a category. The entityID must be a valid URI (URL or URN) where in the
case of a URN the last component must be a valid hostname.

320 321
If metadata is not parsed from SAML2 metadta (using the setting
$useSAML2Metadata = false), the IdPs and category entries will be displayed
Lukas Haemmerle's avatar
Lukas Haemmerle committed
322 323
in order as defined in the configuration file and no sorting is done.

324 325 326
If SAML2 metadata is used ($useSAML2Metadata = true) to generate the list of
Identity Providers, they are sorted within the category/type according to their
Index value (see below) and then alphabetically after their (local) Name.
Lukas Haemmerle's avatar
Lukas Haemmerle committed
327 328
If an IdP has no type, it will be in the category 'unknown', which will be added
at the end of the drop down list.
329
If an IdP has a type for which no category was defined, it will also be added
Lukas Haemmerle's avatar
Lukas Haemmerle committed
330 331 332
to the category unknown but  will keep its type value, which is used for sorting
and for the categories of the Embedded Discovery Service.

333
A general entry for an Identity Provider, a cascaded WAYF/DS or a category is
Lukas Haemmerle's avatar
Lukas Haemmerle committed
334 335 336 337
of the following form:

$IDProviders[{KEY}] = {ENTRY}

338
* {KEY} is a unique value that must correspond to the entity's entityID in case
Lukas Haemmerle's avatar
Lukas Haemmerle committed
339 340 341
  the entry stands for an Identity Provider. For entries of Type category, the
  {KEY'} should be an identifier that corresponds to a 'Type' of an IdP.

342
* '{ENTRY} is a hash array with the following keys:
Lukas Haemmerle's avatar
Lukas Haemmerle committed
343

344 345 346 347 348
  * ['Type']:   Optional
    Type that is used for the embedded wayf to hide or show certain categories.
    Default type will be 'unknown' if not specified.
    An entry for another WAYF/DS that the user should be redirected to should
    have ['Type'] ='wayf
Lukas Haemmerle's avatar
Lukas Haemmerle committed
349 350
    The Type values 'category' and 'wayf' are reserved words that are not allowed
    to be assigned to entries for Identity Providers.
351 352

  * ['Name']:   Mandatory
Lukas Haemmerle's avatar
Lukas Haemmerle committed
353
    Default name to display in drop-down list
354 355 356

  * [{LANG}]:   Optional
    {LANG} is a language identifier, e.g. 'en-GB', 'it', 'fr-F', 'de', ...
Lukas Haemmerle's avatar
Lukas Haemmerle committed
357
    The value is an array with the following keys:
358
    - ['Name']:     Optional
Lukas Haemmerle's avatar
Lukas Haemmerle committed
359
      Display name
360 361
    - ['Keywords']: Optional
      Keywords associated with the Identity Provider.
Lukas Haemmerle's avatar
Lukas Haemmerle committed
362
      Used for search-as-you-type feature of improved drop-down list. Space delimited.
363 364

  * ['SSO']:    Mandatory
Lukas Haemmerle's avatar
Lukas Haemmerle committed
365
    Should be the SAML1 SSO endpoint of the IdP
366
  * ['Realm']:  Optional
Lukas Haemmerle's avatar
Lukas Haemmerle committed
367
    Kerberos Realm
368 369
  * ['IP'][]:   Optional
    IP ranges of that organizations that can be used to guess a user's Identity
Lukas Haemmerle's avatar
Lukas Haemmerle committed
370
     Provider
371 372 373
  * ['Index']:  Optional
    An alphanumerical value that is used for sorting categories and Identity
    Provider in ascending order if the Identity Providers are parsed from metadata.
Lukas Haemmerle's avatar
Lukas Haemmerle committed
374 375 376 377
    This is only relevant if $includeLocalConfEntries = true


For category entries, only Type, (local) Name and Index are relevant.
378 379
The format for the file $metadataSPFile is very similar.
A general entry for an Identity Provider, a cascaded WAYF/DS or a category is
Lukas Haemmerle's avatar
Lukas Haemmerle committed
380 381 382 383 384 385
of the following form:

$metadataSProviders[{KEY}] = {ENTRY}

* {KEY} is a unique value that must correspond to the Service Provider's entityID.

386
* 'ENTRY} is a hash array with the following keys:
Lukas Haemmerle's avatar
Lukas Haemmerle committed
387

388 389 390 391
  * ['Name']:       Mandatory
    Default name to display in drop-down list. By default the MDUI:DisplayName,
    the ServiceName or the entityID is used. If there is a display name
    available in the WAYF's default language that one will be used. Otherwise
Lukas Haemmerle's avatar
Lukas Haemmerle committed
392
    English or the only  available DisplayName is used.
393 394 395

  * [{LANG}]:   Optional
    {LANG} is a language identifier, e.g. 'en-GB', 'it', 'fr-F', 'de', ...
Lukas Haemmerle's avatar
Lukas Haemmerle committed
396
    The value is an array with the following keys:
397
    - ['Name']:     Optional
Lukas Haemmerle's avatar
Lukas Haemmerle committed
398
      Display name
399 400

  * ['DSURL']:      Optional
Lukas Haemmerle's avatar
Lukas Haemmerle committed
401
    List of DiscoveryService endpoints of the SP.
402 403

  * ['ACURL']:      Mandatory
Lukas Haemmerle's avatar
Lukas Haemmerle committed
404
    List of Assertion Consumer endpoints of the SP.
405 406

  * ['Protocols']:  Mandatory
Lukas Haemmerle's avatar
Lukas Haemmerle committed
407 408 409 410 411 412 413 414 415
    Protocols supported by the SP, e.g.: urn:oasis:names:tc:SAML:2.0:protocol
    urn:oasis:names:tc:SAML:1.1:protocol

-------------------------------------------------------------------------------

Path Info parameters and files
------------------------------

Modifying the WAYF's URL it is possible to influence its behaviour. This can be
416
done by appending certain Path Info extension to the URL. The Path Info
Lukas Haemmerle's avatar
Lukas Haemmerle committed
417 418 419 420 421 422 423 424 425
components can also be combined. The allowed syntax is:

* [/{I18N-STRING}][/redirect][/{ENTITYID-HOSTNAME}]
* [/{I18N-STRING}][/embedded-wayf.js]
* [/embedded-wayf.js/snippet.html]
* [/IDProviders.json]
* [/IDProviders.php]
* [/IDProviders.txt]

426
**Note:**
Lukas Haemmerle's avatar
Lukas Haemmerle committed
427 428 429 430 431 432 433 434 435
The web server must support the use of Path Info.

-------------------------------------------------------------------------------


Hinted Identity Provider and transparent redirects
--------------------------------------------------
Path Info Extensions: [/redirect][/{ENTITYID-HOSTNAME}]

436
{ENTITYID-HOSTNAME} must be the host name of an entityId or the last component
Lukas Haemmerle's avatar
Lukas Haemmerle committed
437 438 439 440 441
of a URN. Examples:

* https://aai-login.switch.ch/idp/shibboleth         -> aai-login.switch.ch
* urn:mace:switch.ch:aaitest:aai-demo-idp.switch.ch  -> aai-demo-idp.switch.ch

442
If '/redirect' is included in the Path Info as well, the web browser is
Lukas Haemmerle's avatar
Lukas Haemmerle committed
443 444 445 446 447 448 449 450 451 452 453 454 455
redirected transparently to the specified entityID hostname.

**Note**
One must make sure that the entityID hostname is not the same as one of
the reserved keywords like 'redirect', the below mentioned file types
or a i18n langauge abbreviation.

-------------------------------------------------------------------------------

Language preselection:
----------------------
Path Info Extensions: [/{I18N-STRING}]

456 457 458 459
Examples of {I18N-STRING} strings are 'en', 'de_CH' or 'fr_CH.ISO8859-1' etc.
However, in the default distribution only 'en', 'de', 'fr', 'it' and 'pt' are
available and  supported. But it would be easy to create sub types of existing
languages  for country/region support by adding something like this to
Lukas Haemmerle's avatar
Lukas Haemmerle committed
460 461 462
languages.php:


463 464
    // Create a country specific copy of the German language strings
    $langStrings['de_CH'] = $langStrings['de'];
Lukas Haemmerle's avatar
Lukas Haemmerle committed
465

466 467
    // Overwrite a specific string
    $langStrings['de_CH']['title'] = 'Auswahl der Heimorganisation';
Lukas Haemmerle's avatar
Lukas Haemmerle committed
468 469 470

-------------------------------------------------------------------------------

471 472
Multi-tenant Deployment:
------------------------
473
If there should be deployed multiple instances of the SWITCHwayf
474 475 476 477 478
on the same host, it might be desired to make all instances
use the same code base but different configuration files.
To achieve this, the SWITCHWAYF_CONFIG environment variable can
be used.

479 480 481 482 483
The usage of SWITCHWAYF_CONFIG environment variable allows to
specify an alternative location for the configuration file.
The default configuration file is still used, if this variable
is not defined. This allows a single software deployment to
provides a discovery services for multiple federations,
484 485
depending of virtual host or URL used.

486 487
Below is an example of an Apache httpd server configuration
with two different virtual hosts using different
488 489 490 491 492 493 494
configuration files:

    DocumentRoot /usr/share/switchwayf
    <Directory /usr/share/switchwayf>
        Require all granted
        DirectoryIndex WAYF
    </Directory>
495

496 497 498 499
    <VirtualHost *:443>
        ServerName wayf.switch.ch
        SetEnv SWITCHWAYF_CONFIG=/etc/switchwayf/switch_config.php
    </VirtualHost>
500

501 502 503 504 505 506 507 508
    <VirtualHost *:443>
        ServerName wayf.edugain.org
        SetEnv SWITCHWAYF_CONFIG=/etc/switchwayf/edugain_config.php
    </VirtualHost>

-------------------------------------------------------------------------------


Lukas Haemmerle's avatar
Lukas Haemmerle committed
509 510 511
Special handlers:
-----------------
In order for the Embedded WAYF feature to work there are some special files that
512
need to be generated. The following Path Info Extensions must be the last
Lukas Haemmerle's avatar
Lukas Haemmerle committed
513 514 515 516
components of the Path Info URL.

Path Info Extensions:

517 518 519
* [/deleteSettings]
  As the name suggests, this handler delete all settings cookies that were stored
  by the WAYF service in cookies. Unless there is a 'return' GET argument
Lukas Haemmerle's avatar
Lukas Haemmerle committed
520 521
  provided the user is sent to the settings page.

522
* [/embedded-wayf.js]
Lukas Haemmerle's avatar
Lukas Haemmerle committed
523 524
  Generates the JavaScript for the Embedded WAYF

525
* [/embedded-wayf.js/snippet.html
Lukas Haemmerle's avatar
Lukas Haemmerle committed
526 527
  Generates HTML snippet for the Embedded WAYF

528 529
* [/ShibbolethDS-IDProviders.js]
  Returns JavaScript consisting of only a variable called myJSONObject. It
Lukas Haemmerle's avatar
Lukas Haemmerle committed
530
  contains the IDProviders array. If $exportPreselectedIdP = true, the last
531 532
  element of that array will be a key called 'preselectedIDP', which contains
  the  Identity Provider that would be preselected in the drop-down list for
Lukas Haemmerle's avatar
Lukas Haemmerle committed
533 534
  that user.

535
* [/ShibbolethDS-IDProviders.json]
Lukas Haemmerle's avatar
Lukas Haemmerle committed
536 537
  Same as above but as a JSON data array.

538
* [/IDProviders.txt]
Lukas Haemmerle's avatar
Lukas Haemmerle committed
539 540
  Same as above but in human readable form.

541
* [/IDProviders.php]
Lukas Haemmerle's avatar
Lukas Haemmerle committed
542 543
  Same as above but as PHP code