„SimpleSAMLphp” változatai közötti eltérés
(→IdP beállítás) |
|||
52. sor: | 52. sor: | ||
==IdP beállítás== | ==IdP beállítás== | ||
+ | ===IdP funkció engedélyezése=== | ||
+ | A <code>config/config.php</code> fájlt kell szerkesztenünk, s engedélyezni a saml20 idp lehetőséget. | ||
+ | 'enable.saml20-idp' => true, | ||
+ | ===Autentikáció LDAP alapon=== | ||
+ | Meg kell adni, hogy az IdP milyen módon azonosítsa a felhasználót, amennyiben alapértelmezés szerint nem engedélyezett modult szeretnénk használni, úgy a megfelelő modult a <code>modules</code> könyvtár alatt engedélyezni kell. Az alábbi példában az LDAP alapú azonosítást mutatjuk be, amely külön modult nem igényel, alapértelmezés szerint része a telepített alkalmazásnak. | ||
+ | |||
+ | Ahhoz, hogy megadhassuk az LDAP-hoz tartozó beállításokat, a <code>config/authsources.php</code> fájlt kell szerkesztenünk. Az alábbi kódrészletet elegendő beszúrni, és az egyes változóknak a helyi LDAP-nak megfelelő adatokat értékül adni. | ||
+ | 'example-ldap' => array( | ||
+ | 'ldap:LDAP', | ||
+ | |||
+ | /* The hostname of the LDAP server. */ | ||
+ | 'hostname' => 'ldap.example.org', | ||
+ | |||
+ | /* Whether SSL/TLS should be used when contacting the LDAP server. */ | ||
+ | 'enable_tls' => FALSE, | ||
+ | |||
+ | /* | ||
+ | * Which attributes should be retrieved from the LDAP server. | ||
+ | * This can be an array of attribute names, or NULL, in which case | ||
+ | * all attributes are fetched. | ||
+ | */ | ||
+ | 'attributes' => NULL, | ||
+ | |||
+ | /* | ||
+ | * The pattern which should be used to create the users DN given the username. | ||
+ | * %username% in this pattern will be replaced with the users username. | ||
+ | * | ||
+ | * This option is not used if the search.enable option is set to TRUE. | ||
+ | */ | ||
+ | 'dnpattern' => 'uid=%username%,ou=people,dc=example,dc=org', | ||
+ | |||
+ | /* | ||
+ | * As an alternative to specifying a pattern for the users DN, it is possible to | ||
+ | * search for the username in a set of attributes. This is enabled by this option. | ||
+ | */ | ||
+ | 'search.enable' => FALSE, | ||
+ | |||
+ | /* | ||
+ | * The DN which will be used as a base for the search. | ||
+ | * This can be a single string, in which case only that DN is searched, or an | ||
+ | * array of strings, in which case they will be searched in the order given. | ||
+ | */ | ||
+ | 'search.base' => 'ou=people,dc=example,dc=org', | ||
+ | |||
+ | /* | ||
+ | * The attribute(s) the username should match against. | ||
+ | * | ||
+ | * This is an array with one or more attribute names. Any of the attributes in | ||
+ | * the array may match the value the username. | ||
+ | */ | ||
+ | 'search.attributes' => array('uid', 'mail'), | ||
+ | |||
+ | /* | ||
+ | * The username & password the simpleSAMLphp should bind to before searching. If | ||
+ | * this is left as NULL, no bind will be performed before searching. | ||
+ | */ | ||
+ | 'search.username' => NULL, | ||
+ | 'search.password' => NULL, | ||
+ | ), |
A lap 2010. február 8., 16:21-kori változata
Az alábbi lapon megkíséreljük összefoglalni a legfontosabb lépéseket, melyek általános esetben elegendőek ahhoz, hogy működő SimpleSAMLphp(SSP) alkalmazást állítsunk üzembe.
Tartalomjegyzék
Telepítés
Előkészületek
Ahhoz, hogy problémamentesen telepíthessük SSP alkalmazásunkat, az alábbi szoftverkomponenseknek kell működniük szerverünkön.
- PHP futtatására alkalmas webszerver
- PHP környezet (legalább 5.2.0 verzió)
- A következő PHP kiterjesztéseket engedélyezni kell
-
date
,dom
,hash
,libxml
,openssl
,pcre
,SPL
,zlib
- LDAP-ból történő autentikáció esetén:
ldap
- Adatbázisból történő autentikáció esetén a megfelelő adatbázis-csatolót
mysql
,pgsql
- RADIUS szerveren keresztül történő autentikáció esetén:
radius
- Assertion-ök titkosítása esetén:
mcrypt
- Memcache használata esetén:
memcache
-
Letöltés
A legfrissebb változat letölthető http://code.google.com/p/simplesamlphp/ címről
cd /var tar xzf simplesamlphp-1.x.y.tar.gz mv simplesamlphp-1.x.y simplesamlphp
Alapértelmezés szerint a /var/simplesamlphp
alatt szeretne majd működni, ez természetesen változtatható, de most maradunk az eredeti beállításoknál.
Apache konfigurálás
A webről csak a /var/simplesamlphp/www
könyvtárat kell elérni.
<VirtualHost *> ServerName service.example.com DocumentRoot /var/www/service.example.com Alias /simplesaml /var/simplesamlphp/www </VirtualHost>
Alapbeállítások
Mielőtt aktiváljuk valamelyik főszolgáltatását (IdP,SP...) a telepített alkalmazásnak, néhány beállítást meg kell adnunk a konfigurációs fájlban config.php
.
- Az "admin" felhasználó jelszavát, mellyel webes felületen keresztül be tud lépni a települő SSP-be.
'auth.adminpassword' => 'ujjelszotirdide',
- Titkosítási feladatokhoz szükséges "salt", azaz véletlenszerűen összeálló karaktersorozat
'secretsalt' => 'randombytesinsertedhere',
A karaktersorozat előállításában segíthet az alábbi parancs:
tr -c -d '0123456789abcdefghijklmnopqrstuvwxyz' </dev/urandom | dd bs=32 count=1 2>/dev/null;echo
- Elérhetőségeket, amely adatok bekerülnek majd a generált metaadatba
'technicalcontact_name' => 'Gipsz Jakab', 'technicalcontact_email' => 'jakab.gipsz@example.org',
- Nyelv és időzóna adatok
'language.default' => 'hu', 'timezone' => 'Europe/Budapest',
Telepítés kész
Amennyiben elkészültünk a fenti lépésekkel, úgy a https://service.example.org/simplesaml/ címen elérjük a telepített SSP-nk webes adminfelületét, ahol megejthetjük a további beállítások nagy részét.
IdP beállítás
IdP funkció engedélyezése
A config/config.php
fájlt kell szerkesztenünk, s engedélyezni a saml20 idp lehetőséget.
'enable.saml20-idp' => true,
Autentikáció LDAP alapon
Meg kell adni, hogy az IdP milyen módon azonosítsa a felhasználót, amennyiben alapértelmezés szerint nem engedélyezett modult szeretnénk használni, úgy a megfelelő modult a modules
könyvtár alatt engedélyezni kell. Az alábbi példában az LDAP alapú azonosítást mutatjuk be, amely külön modult nem igényel, alapértelmezés szerint része a telepített alkalmazásnak.
Ahhoz, hogy megadhassuk az LDAP-hoz tartozó beállításokat, a config/authsources.php
fájlt kell szerkesztenünk. Az alábbi kódrészletet elegendő beszúrni, és az egyes változóknak a helyi LDAP-nak megfelelő adatokat értékül adni.
'example-ldap' => array( 'ldap:LDAP', /* The hostname of the LDAP server. */ 'hostname' => 'ldap.example.org', /* Whether SSL/TLS should be used when contacting the LDAP server. */ 'enable_tls' => FALSE, /* * Which attributes should be retrieved from the LDAP server. * This can be an array of attribute names, or NULL, in which case * all attributes are fetched. */ 'attributes' => NULL, /* * The pattern which should be used to create the users DN given the username. * %username% in this pattern will be replaced with the users username. * * This option is not used if the search.enable option is set to TRUE. */ 'dnpattern' => 'uid=%username%,ou=people,dc=example,dc=org', /* * As an alternative to specifying a pattern for the users DN, it is possible to * search for the username in a set of attributes. This is enabled by this option. */ 'search.enable' => FALSE, /* * The DN which will be used as a base for the search. * This can be a single string, in which case only that DN is searched, or an * array of strings, in which case they will be searched in the order given. */ 'search.base' => 'ou=people,dc=example,dc=org', /* * The attribute(s) the username should match against. * * This is an array with one or more attribute names. Any of the attributes in * the array may match the value the username. */ 'search.attributes' => array('uid', 'mail'), /* * The username & password the simpleSAMLphp should bind to before searching. If * this is left as NULL, no bind will be performed before searching. */ 'search.username' => NULL, 'search.password' => NULL, ),