# Shib3IdpInstall

Az alábbiakban a [Shibboleth 3 Identity Provider](http://shibboleth.net/products/identity-provider.html) telepítése olvasható egyszerű beállítással.

A telepítés *Debian 8 (Jessie)* operációs rendszerre történik [Jetty 9.2](http://www.eclipse.org/jetty/) alkalmazáskonténerbe.

## Előkészületek

Telepítés előtt praktikus előkészíteni az Shibboleth 3 Identity Provider (IdP) környezetét. Az IdP központi szerepet tölt be, így elérhetősége szerencsés esetben ritkán változik.

- `entityID` (URI) 
    - z entityID az a SAML azonosító, mely egyedi névvel látja el az IdP-t. Az első lépések egyike telepítéskor a megfelelő és gondos kiválasztása. Föderáción belül és világszinten egyedi kell legyen az ütközések elkerülése érdekében.
    - avasolt forma: **`https://idp.intezmenyneve.hu/idp/shibboleth`**.
    - gépnév rész legyen bejegyzett DNS név.
    - e tartalmazzon portszámot, lekérdezést, részazonosítót.
- `DNS`
    - Az entityID megtalálása után szükséges az IdP nevének DNS-be jegyzése.
    - avasolt forma: **`idp.intezmenyneve.hu`**.

<p class="callout warning">**Warning**  
  
Az entityID a szolgáltatás neve, nem a kiszolgáló számítógépé. Érdemes a neveket úgy megválasztani, hogy egy későbbi gépcsere esetén is független legyen a gépnév a szolgáltatás nevétől.</p>

- `Tűzfal`
    - Szükséges nyitott portok a *TCP/443* és *TCP/8443*.
- `Operációs rendszer és Java futtató-környezet`
    - A jelen telepítési leírás Debian 8 (Jessie) rendszerhez készült.
    - Java telepítése
    - `apt-get install default-jdk`

## Jetty 9.2 telepítés és előkészítés

Letöltés: [http://download.eclipse.org/jetty/](http://download.eclipse.org/jetty/)

Telepítés menete.

```bash
cd /opt
tar -xf jetty-distribution-9.2.<legutóbbi stabil verzió>.tar.gz

```

Jetty előkészítése Shibboleth 3 IdP számára.

```bash
cd /opt
mkdir jetty-shibboleth-idp
cd jetty-shibboleth-idp
mkdir etc modules lib logs resources webapps tmp
cd /opt/jetty-distribution-9.<legutóbbi stabil verzió>
cp etc/jetty-ssl.xml /opt/jetty-shibboleth-idp/etc/
cp etc/jetty-https.xml /opt/jetty-shibboleth-idp/etc/
cp etc/keystore /opt/jetty-shibboleth-idp/etc/
cp etc/keystore.pkf /opt/jetty-shibboleth-idp/etc/
cp modules/https.mod /opt/jetty-shibboleth-idp/modules/
cp modules/ssl.mod /opt/jetty-shibboleth-idp/modules/

```

Hozzuk létre a Jetty `start.ini` állományt az alábbi tartalommal az `/opt/jetty-shibboleth-idp/start.ini` helyen.

```ini
# Required Jetty modules
--module=server
--module=deploy
--module=annotations
--module=resources
--module=logging
--module=requestlog
--module=https
--module=ssl
--module=servlets
--module=jsp
--module=jstl
--module=ext
--module=plus

# Allows setting Java system properties (-Dname=value)
# and JVM flags (-X, -XX) in this file
# NOTE: spawns child Java process
--exec

-Didp.home=/opt/shibboleth-idp

-Djava.io.tmpdir=tmp

# Maximum amount of memory that Jetty may use, at least 512M is recommended
-Xmx512m

# Maximum amount of memory allowed for the JVM permanent generation
-XX:MaxPermSize=128m

```

Webapp XML állomány létrehozása az IDP-hez az `/opt/jetty-shibboleth/webapps/idp.xml` helyen az alábbi tartalommal.

```xml
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="war"><SystemProperty name="idp.home"/>/war/idp.war</Set>
  <Set name="contextPath">/idp</Set>
  <Set name="extractWAR">false</Set>
  <Set name="copyWebDir">false</Set>
  <Set name="copyWebInf">true</Set>
</Configure>

```

## Shibboleth 3 Identity Provider telepítés Jetty 9.2 konténerbe

Letöltés: [http://shibboleth.net/downloads/identity-provider/latest/](http://shibboleth.net/downloads/identity-provider/latest/)

```bash
cd /opt
wget http://shibboleth.net/downloads/identity-provider/latest/shibboleth-identity-provider-VERSION.tar.gz
tar -xf shibboleth-identity-provider-VERSION.tar.gz

```

Telepítés

```
root@idp:~# cd /opt/shibboleth-identity-provider-VERSION
root@idp:/opt/shibboleth-identity-provider-3.1.1# bin/install.sh
Source (Distribution) Directory: [/opt/shibboleth-identity-provider-3.1.1]

Installation Directory: [/opt/shibboleth-idp]

Hostname: [localhost.localdomain]
**idp.intezmenyneve.hu**
SAML EntityID: https://idp.intezmenyneve.hu/idp/shibboleth

Attribute Scope: [localdomain]
**intezmenyneve.hu**
TLS Private Key Password: ********
Re-enter password: ********
Cookie Encryption Key Password: ********
Re-enter password: ********
Warning: /opt/shibboleth-idp/bin does not exist.
Warning: /opt/shibboleth-idp/dist does not exist.
Warning: /opt/shibboleth-idp/doc does not exist.
Warning: /opt/shibboleth-idp/system does not exist.
Warning: /opt/shibboleth-idp/webapp does not exist.
Generating Signing Key, CN = idp.intezmenyneve.hu URI = https://idp.intezmenyneve.hu/idp/shibboleth ...
...done
Creating Encryption Key, CN = idp.intezmenyneve.hu URI = https://idp.intezmenyneve.hu/idp/shibboleth ...
...done
Creating TLS keystore, CN = idp.intezmenyneve.hu URI = https://idp.intezmenyneve.hu/idp/shibboleth ...
...done
Creating cookie encryption key files...
...done
Rebuilding /opt/shibboleth-idp/war/idp.war ...
...done

BUILD SUCCESSFUL
Total time: 1 minute 21 seconds
root@idp:/opt/shibboleth-identity-provider-3.1.1#

```

## Az IdP indítása

```bash
cd /opt/jetty-shibboleth-idp
java -jar /opt/jetty-distribution-9.2.<legutóbbi stabil verzió>/start.jar

```

Böngészőben a [https://idp.intezmenyneve.hu:8443/idp](https://idp.intezmenyneve.hu:8443/idp) URL-en rövid tájékoztatást kell kapnunk *No services are available at this location.* szöveggel.