From 43e57a42832ea8b4ceb0317f3c9028a4174ffa7b Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 8 Aug 2007 07:25:32 +0000 Subject: Adapted project directory structure to suit the new maven based build process. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@909 d688527b-c9ab-4aba-bd8d-4036d912da1d --- id/server/doc/moa_id/id-admin_1.htm | 539 ++++++++++++++++++++++++++++++++++++ 1 file changed, 539 insertions(+) create mode 100644 id/server/doc/moa_id/id-admin_1.htm (limited to 'id/server/doc/moa_id/id-admin_1.htm') diff --git a/id/server/doc/moa_id/id-admin_1.htm b/id/server/doc/moa_id/id-admin_1.htm new file mode 100644 index 000000000..289c52d8a --- /dev/null +++ b/id/server/doc/moa_id/id-admin_1.htm @@ -0,0 +1,539 @@ + + + MOA ID-Administration + + + + + + + + + +
+ + +
+ Module für Online-Applikationen +
+
+  +
+
+Projekt moa  +
+
+ + + + + + +
+
MOA-ID

+ +
+ Basis-Installation
+ + +
+ +
+ +
+

Basis-Installation v.1.4

+Bei der Basis-Installation von MOA-ID-AUTH und von MOA-ID-PROXY ist grundsätzlich gleichartig vorzugehen. +Unterschiede sind in der Installationsanweisung angeführt. +
+

Vorbereitung

+
+

Installation des JDK
+ Installieren Sie das JDK in ein + beliebiges Verzeichnis. Das Wurzelverzeichnis der JDK-Installation + wird im weiteren Verlauf als $JAVA_HOME bezeichnet.
+
+ Installation von Tomcat
+ Installieren Sie Tomcat in ein Verzeichnis, das keine Leer- und + Sonderzeichen im Pfadnamen enthält. Am Besten verwenden + die referenzierte Version von Tomcat im zip-Format. (Hinweis f. + Windows: nicht die selbstinstallierende exe Version verwenden.) + Das Wurzelverzeichnis der Tomcat-Installation wird im weiteren Verlauf + als $CATALINA_HOME bezeichnet.
+
+ Entpacken der MOA ID Webapplikation
+ Entpacken Sie die ausgelieferten Dateien der Webapplikation (moa-id-auth-x.y.zip + oder moa-id-proxy-x.y.zip; ersetzen Sie x.y durch die Releasenummer + von MOA-ID-AUTH bzw. MOA-ID-PROXY) in ein beliebiges Verzeichnis. + Diese Verzeichnisse werden im weiteren Verlauf als $MOA_ID_INST_AUTH + bzw. $MOA_ID_INST_PROXY bezeichnet.
+
+ Installation der IAIK JCE und des IAIK LDAP Protocol Handlers
+ Die Dateien aus dem Verzeichnis $MOA_ID_INST_AUTH/ext (oder $MOA_ID_INST_PROXY/ext) + müssen in das Verzeichnis $JAVA_HOME/jre/lib/ext kopiert werden. + Anschließend steht eine Unterstützung für Kryptographie + und SSL jeder Java-Anwendung die dieses JDK verwendet zur Verfügung.
+
+ Zusätzlich müssen die so genannten Unlimited Strength + Jurisdiction Policy Files heruntergeladen, entpackt + und ins Verzeichnis $JAVA_HOME/jre/lib/security kopiert werden.

+

Der Download für diese Dateien findet sich am unteren Ende + der Download-Seite des jeweiligen JDK in der Sektion "Other + Downloads". D.h. JDK + hier für 1.4.0, das JDK hier + für 1.4.2 bzw. das JDK hier + für 1.5.0.

+
+ +
+ +
+ + +
+

 

+
+

+
+
+

Konfiguration von Tomcat

+
+Minimale Konfiguration
+Die zentrale Konfigurations-Datei von Tomcat ist $CATALINA_HOME/conf/server.xml. Tomcat wird grundsätzlich mit +einer funktionierenden Default-Konfiguration ausgeliefert, die jedoch einiges an Ballast enthält und viele Ports +offen lässt. Die Datei $MOA_ID_INST_AUTH/tomcat/server.xml (bzw. $MOA_ID_INST_PROXY/tomcat/server.xml) enthält eine minimale +Tomcat-Konfiguration, die je einen Connector für HTTP und für HTTPS freischaltet.

+SSL
+Für den sicheren Betrieb von MOA-ID-AUTH ist die Verwendung von SSL Voraussetzung, sofern nicht ein vorgelagerter WebServer (Apache oder IIS) das SSL-Handling übernimmt. +Ebenso kann SSL auch für MOA-ID-PROXY verwendet werden. +Das Dokument Tomcat SSL Configuration HOW-TO gibt einen guten Überblick über die Konfiguration von SSL in Tomcat. Da die für SSL notwendigen Bibliotheken bereits im Abschnitt "Vorbereitung" eingebunden wurden, sind nur noch folgende Schritte notwendig: +
+
    +
  • Erstellung eines Server-Keystores, welches den privaten Schlüssel des Servers sowie das Server-Zertifikat enthält, +z.B. mit dem Java Keytool.
    +Hinweis: Standardmäßig wird beim Erzeugen eines neuen Keystores im Home-Verzeichnis des Benutzers die Datei ".keystore" angelegt. Möchte man den Dateinamen und Pfad ändern, kann man das dem SSL-Connector in $CATALINA_HOME/conf/server.xml durch hinzufügen des Attributes keystoreFile="NAME DES KEYSTORES" im Element <Factory> bekannt machen. Das zum Keystore gehörende Passwort übergibt man Tomcat mittels des Attributes keystorePass= "PASSWORT DES KEYSTORES" im Element <Factory>.
  • +
  • Erstellung eines Keystores mit vertrauenswürdigen Client-Zertifikaten, z.B. mit dem Java Keytool (nur, wenn SSL Client-Authentisierung verwendet werden soll)
  • +
  • Falls eine Client-Authentisierung gewünscht ist, muss die Konfiguration des SSL-Connectors in $CATALINA_HOME/conf/server.xml angepasst werden.
  • +
+ +
+MOA Administrator
+Der Aufruf der URL für die dynamische Konfiguration von MOA-ID-AUTH ist durch eine Passwort-Abfrage geschützt, und kann nur von Benutzern aufgerufen werden, die der Benutzer-Rolle moa-admin zugeordnet werden können.
+Um diese Benutzer-Rolle und einen oder mehrere Benutzer einzurichten, müssen in der Datei $CATALINA_HOME/conf/tomcat-users.xml unter dem Element <tomcat-users> sinngemäß folgende Einträge hinzugefügt werden: +
+<role rolename="moa-admin"/>
+<user username="moa" password="moa" roles="moa-admin"/>
+
+
+
+ +
+ + +
+

 

+
+

+
+
+

Deployment von MOA-ID-AUTH in Tomcat

+
+Um MOA-ID-AUTH in Tomcat für den Ablauf vorzubereiten, sind folgende Schritte notwendig:
+
    +
  • Die Datei $MOA_ID_INST_AUTH/moa-id-auth.war wird ins Verzeichnis + $CATALINA_HOME/webapps kopiert. Dort wird sie beim ersten Start + von Tomcat automatisch ins Verzeichnis $CATALINA_HOME/webapps/moa-id-auth + entpackt.
  • +
  • Die MOA-ID Konfigurationsdatei und die zugehörigen Verzeichnisse + "certs" und "transforms" werden in ein beliebiges Verzeichnis + im Filesystem kopiert (z.B. $CATALINA_HOME/conf/moa-id).
    + Im Verzeichnis $MOA_ID_INST_AUTH/conf/moa-id befinden sich + acht verschiedene Beispielkonfigurationen, die als Ausgangspunkte + für die Konfiguration von MOA-ID-AUTH dienen können: +
      +
    • SampleMOAIDConfiguration.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem öffentlichen Bereich. +
      Karte: Bürgerkarte +
      Konfiguration ohne Proxykomponente
    • +
    • SampleMOAIDConfiguration_withTestBKs.xml: Konfiguration von MOA-ID + für eine Anwendung aus dem öffentlichen Bereich. +
      Karte: Bürgerkarte und Testkarte +
      Konfiguration ohne Proxykomponente
    • +
    • SampleMOAWIDConfiguration.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). +
      Karte: Bürgerkarte +
      Konfiguration ohne Proxykomponente
    • +
    • SampleMOAWIDConfiguration_withTestBKs.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). +
      Karte: Bürgerkarte und Testkarte +
      Konfiguration ohne Proxykomponente
    • +
    • SampleMOAIDConfigurationProxy.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem öffentlichen Bereich. +
      Karte: Bürgerkarte +
      Konfiguration mit Proxykomponente.
    • +
    • SampleMOAIDConfiguration_withTestBKsProxy.xml: Konfiguration von MOA-ID + für eine Anwendung aus dem öffentlichen Bereich. +
      Karte: Bürgerkarte und Testkarte +
      Konfiguration mit Proxykomponente
    • +
    • SampleMOAWIDConfigurationProxy.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). +
      Karte: Bürgerkarte +
      Konfiguration mit Proxykomponente
    • +
    • SampleMOAWIDConfiguration_withTestBKsProxy.xml: Konfiguration von MOA-ID für + eine Anwendung aus dem privatwirtschaftlichen Bereich (MOA-WID Modus). +
      Karte: Bürgerkarte und Testkarte +
      Konfiguration mit Proxykomponente
    • +
    +
  • +
  • Die endorsed Libraries für Tomcat müssen aus dem + Verzeichnis $MOA_ID_INST_AUTH/endorsed in das Tomcat-Verzeichnis + $CATALINA_HOME/common/endorsed kopieren werden. Folgende Libraries + sind für das Deployment im endorsed Verzeichnis vorgesehen: +
      +
    • Xerces-J-2.4.0 (bestehend aus xercesImpl.jar + und xmlParserAPIs.jar) - für alle JDKs.
    • +
    • Xalan-j-2.5.1 (bestehend aus xalan.jar).
    • +
    + Eventuell vorhandene Dateien mit dem gleichen Namen müssen + ersetzt werden. Die ggf. in diesem Verzeichnis vorhandene Datei + xml-apis.jar muss gelöscht werden.
  • +
  • Folgende Java System Properties sind zu setzen:
    +
      +
    • moa.id.configuration=Name der MOA ID Konfigurationsdatei. + Eine beispielhafte MOA ID Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/ + SampleMOAIDConfiguration.xml enthalten.
    • +
    • log4j.configuration=URL der Log4j Konfigurationsdatei. + Eine beispielhafte Log4j-Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/log4j.properties + enthalten.
    • +
    • javax.net.ssl.trustStore=Name des Truststores + für vertrauenswürdige SSL Client-Zertifikate (optional; + nur, wenn SSL Client-Authentisierung durchgeführt werden + soll).
      +
    • +
    + Diese Java System-Properties werden Tomcat über die Umgebungsvariable + CATALINA_OPTS mitgeteilt (Beispiel-Skripte zum Setzen dieser + Properties für Windows und für Unix bzw. + Linux finden sie unter $MOA_ID_INST_AUTH/tomcat/win32 bzw. + $MOA_ID_INST_AUTH/tomcat/unix). Diese Skripte können sie nach $CATALINA_HOME kompieren und in Folge von dort starten nachdem die Variablen CATALINA_HOME sowie JAVA_HOME in den Skripten entsprechend den Pfaden der Installation gesetzt wurden. +
+
+
+ + +
+ + +
+

 

+
+

+
+
+

Deployment von MOA-ID-PROXY in Tomcat

+
+Um MOA-ID-PROXY in Tomcat für den Ablauf vorzubereiten, sind folgende Schritte notwendig: +
+
    +
  • + Für Tomcat 4.1.31: +
      +
    • Die Datei $MOA_ID_INST_PROXY/moa-id-proxy.war wird in ein + beliebiges Verzeichnis (bspw. $CATALINA_HOME/webappsProxy) kopiert. HINWEIS: + Das Verzeichnis darf sich NICHT unterhalb $CATALINA_HOME/webapps befinden!
      +
    • +
    • Anschließend muss in der Datei $CATALINA_HOME/conf/server.xml der + Tomcat-Root-Context auf diese Datei gesetzt werden: wenn + das war-file sich in $CATALINA_HOME/webappsProxy befindet, geschieht dies + mit dem Einfügen von folgendem Element innerhalb von + <Server>...<Service>...<Engine>...<Host>: +
      <Context path="" 
      +    docBase="../webappsProxy/moa-id-proxy.war"
      +    debug="0"/>
      + Anmerkung: Der Root-Context von Tomcat ist normalerweise auskommentiert. +
    • +
    +
  • +
  • + Für Tomcat 5.0.28: +
      +
    • Die Datei $MOA_ID_INST_PROXY/moa-id-proxy.war ist in ein + beliebiges Verzeichnis (bspw. $CATALINA_HOME/webappsProxy) zu entpacken + (diese Datei ist mittels ZIP Algorithmus komprimiert und kann mit jedem Tool, + das mit .ZIP-Dateien umgehen kann, geöffnet werden). HINWEIS: + Das Verzeichnis darf sich NICHT unterhalb $CATALINA_HOME/webapps befinden!
      +
    • +
    • Anschließend muss in der Datei $CATALINA_HOME/conf/server.xml der + Tomcat-Root-Context auf diese Datei gesetzt werden: wenn die Proxy Web-Applikation + nach $CATALINA_HOME\webappsProxy entpackt wurde, geschieht dies mit dem Einfügen + von folgendem Element innerhalb von + <Server>...<Service>...<Engine>...<Host>:
    • +
      <Context path="" docBase="../webappsProxy" 
      +    debug="0"/>
      + Alternativ kann statt die Datei server.xml zu ändern in $CATALINA_HOME\conf\Catalina\localhost eine Datei moa-id-proxy.xml mit vorhin angegebenen Inhalt erstellt werden. +
    +
  • +
+ +
+ Tomcat Konfiguration: +
    +
  • Die MOA-ID Konfigurationsdatei und die zugehörigen + Verzeichnisse "certs" und "oa" werden in ein beliebiges Verzeichnis + im Filesystem kopiert (z.B. $CATALINA_HOME/ conf/moa-id). +
    + Im Verzeichnis $MOA_ID_INST_PROXY/conf/moa-id befinden sich + vier verschiedene Beispielkonfigurationen, + die als Ausgangspunkte für die Konfiguration von MOA-ID-PROXY + dienen können. +
  • +
  • Die endorsed Libraries für Tomcat müssen aus dem + Verzeichnis $MOA_ID_INST_PROXY/endorsed in das Tomcat-Verzeichnis + $CATALINA_HOME/common/endorsed kopiert werden. Folgende Libraries + sind für das Deployment im endorsed Verzeichnis vorgesehen: +
      +
    • Xerces-J-2.4.0 (bestehend aus xercesImpl.jar + und xmlParserAPIs.jar)
    • +
    + Eventuell vorhandene Dateien mit dem gleichen Namen müssen + ersetzt werden. +
  • +
  • Folgende Java System Properties sind zu setzen:
    +
      +
    • moa.id.configuration=Name der MOA ID Konfigurationsdatei. + Eine beispielhafte MOA ID Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/ + SampleMOAIDConfiguration.xml enthalten.
    • +
    • log4j.configuration=URL der Log4j Konfigurationsdatei. + Eine beispielhafte Log4j-Konfiguration ist in $MOA_ID_INST_AUTH/conf/moa-id/log4j.properties + enthalten.
    • +
    • javax.net.ssl.trustStore=Name des Truststores + für vertrauenswürdige SSL Client-Zertifikate + (optional; nur, wenn SSL Client-Authentisierung durchgeführt + werden soll).
    • +
    +
  • + Diese Java System-Properties werden Tomcat über die Umgebungsvariable + CATALINA_OPTS mitgeteilt (siehe Deployment von MOA-ID-AUTH). +
    +
    + Beispiel-Skripts zum Setzen von CATALINA_OPTS und zum Starten + von Tomcat sind in $MOA_ID_INST_AUTH\tomcat\ zu finden - Sie + können diese für Ihre Zwecke adaptieren (JAVA_HOME + und $CATALINA_HOME setzen) und nach $CATALINA_HOME kopieren. +
+
+
+ +
+ + +
+

 

+
+

+
+
+

Starten und Stoppen von Tomcat

+
Nach dem Deployment und der Konfiguration kann + Tomcat aus seinem Wurzelverzeichnis ($CATALINA_HOME) mit
+
+    startTomcat (unter Windows) oder 
+    moa-id-env.sh
+    bin/catalina.sh start (unter Unix/Linux) 
+
+gestartet werden. Das Stoppen von Tomcat erfolgt analog mit
+
+    bin\catalina stop  (unter Windows) oder 
+    bin/catalina.sh stop (unter Unix/Linux) 
+
+Ein erfolgreicher Startvorgang von MOA-ID-AUTH ist an folgender Log-Meldung ersichtlich:
+
+    INFO | 08 13:33:38,497 | main | 
+    	MOA ID Authentisierung wurde 
+    	erfolgreich gestartet
+
+Analog bei MOA-ID-PROXY:
+
+    INFO | 08 13:35:49,876 | main | 
+    	MOA ID Proxy wurde erfolgreich gestartet
+
+ +Nach dem erfolgreichen Starten von Tomcat steht MOA-ID-AUTH unter der URL +
+http(s)://host:port/moa-id-auth/StartAuthentication    
+
+zur Verfügung. Der WebService ist unter +
+http(s)://host:port/moa-id-auth/services/GetAuthenticationData  
+
+erreichbar. Die Verfügbarkeit der Anwendung kann überprüft werden, indem die URLs mit einem Web-Browser aufgerufen werden.
+
+
+Dynamische Konfigurations-Updates
+Dynamische Konfigurations-Updates können für MOA-ID-AUTH durch den Aufruf der URL http://hostname:port/moa-id-auth/ConfigurationUpdate (z.B. durch Eingabe in einem Browser) durchgeführt werden. Analog wird die Konfiguration von MOA-ID-PROXY mittels http://hostname:port/ConfigurationUpdate aktualisiert.

+Hinweis: Konfigurationsänderungen für die Online-Applikationen betreffen grundsätzlich sowohl die Auth- als auch die Proxy-Komponente. +Wenn bspw. das publicURLPrefix der OA geändert wird, muss sowohl für die Auth- als auch für die Proxy-Komponente ein ConfigurationUpdate durchgeführt werden.

+Konnte MOA-ID-AUTH bzw. MOA-ID-PROXY nicht ordnungsgemäß konfiguriert und gestartet werden, geht das aus der Log-Meldung hervor:
+
+FATAL | 03 13:19:06,924 | main | Fehler 
+	beim Starten des Service MOA ID Authentisierung
+
+bzw. +
+FATAL | 03 13:19:06,924 | main | Fehler 
+	beim Starten des Service MOA ID Proxy
+
+In diesem Fall geben die WARN bzw. ERROR Log-Meldungen unmittelbar davor Aufschluss über den genaueren Grund.
+
+
+ + +
+ + +
+

 

+
+

+
+
+
+

Logging

+
+Die MOA ID Webapplikation verwendet Jakarta Log4j für die Ausgabe von Log-Meldungen am Bildschirm bzw. in Log-Dateien. Log4j bietet zahlreiche Konfigurationsmöglichkeiten, die ausführlich im Log4j Handbuch beschrieben sind. Unter anderem gibt es die Möglichkeit, folgende Einstellungen vorzunehmen:
+
    +
  • Das verwendete Log-Level (DEBUG, INFO, WARN, ERROR, FATAL).
  • +
  • Name und maximale Größe der Log-Datei(en).
  • +
  • Das Aussehen der Log-Einträge.
  • +
+Es werden folgende Log-Hierarchien verwendet: +
+
    +
  • moa.id.auth für alle Log-Meldungen aus dem MOA-ID-AUTH Modul
  • +
  • moa.id.proxy für alle Log-Meldungen aus dem MOA-ID-PROXY Modul
  • +
  • moa.spss.server für alle Log-Meldungen aus dem MOA-SPSS Modul
  • +
  • iaik.server für alle Log-Meldungen aus den IAIK Kryptographie-Modulen
  • +
+
+Als Ausgangspunkt für die Logging-Konfiguration liegt die Datei $MOA_ID_INST_AUTH/conf/moa-id/log4j.properties (bzw. $MOA_ID_INST_PROXY/conf/moa-id/log4j.properties) bei. +Wird diese Datei als Logging-Konfiguration verwendet, so werden alle Log-Meldungen sowohl in die Konsole, als auch in die Datei $CATALINA_HOME/logs/moa-id.log geschrieben. +

+Format der Log-Meldungen
+Anhand einer konkreten Log-Meldung wird das Format der MOA ID Log-Meldungen erläutert: +
+    INFO | 09 08:23:59,385 | Thread-8 | 
+    	Anmeldedaten zu MOASession -5468974113772848113 
+    	angelegt, SAML Artifakt 
+    	AAF/BrdRfnMaQVGIbP/Gf9OwDUwwsXChb7nuT+VXQzOoHbV
+
+ +Der Wert INFO besagt, dass die Log-Meldung im Log-Level INFO entstanden ist. Folgende Log-Levels existieren:
+
    +
  • DEBUG: Log-Meldungen im Log-Level DEBUG geben Auskunft über die innere Arbeitsweise des Systems. Sie sind hauptsächlich für Entwickler interessant.
  • +
  • INFO: Diese Log-Meldungen geben informative Status-Informationen über den Ablauf der Webapplikation, wie z.B., dass eine neue Anfrage eingelangt ist.
  • +
  • WARN: Bei der Ausführung einer Operation sind leichte Fehler aufgetreten. Der Ablauf der Webapplikation ist nicht weiter beeinträchtigt.
  • +
  • ERROR: Die Ausführung einer Operation musste abgebrochen werden. Die Webapplikation ist davon nicht beeinträchtigt.
  • +
  • FATAL: Es ist ein Fehler aufgetreten, der den weiteren Betrieb der Webapplikation nicht mehr sinnvoll macht.
  • +
+Der nächste Wert 09 08:23:59,385, gibt den Zeitpunkt an, an dem die Log-Meldung generiert wurde (in diesem Fall den 9. Tag im aktuellen Monat, sowie die genaue Uhrzeit).
+Der Rest der Zeile einer Log-Meldung ist der eigentliche Text, mit dem das System bestimmte Informationen anzeigt. Im Fehlerfall ist häufig ein Java Stack-Trace angefügt, der eine genauere Ursachen-Forschung ermöglicht. +

+ + +Wichtige Log-Meldungen
+Neben den im Abschnitt "Starten und Stoppen von Tomcat" beschriebenen Log-Meldungen, die anzeigen, ob die Webapplikation +ordnungsgemäß gestartet wurde, geben nachfolgenden Log-Meldungen Aufschluss über die Abarbeitung von Anfragen. +Die Annahme einer Anfrage wird beispielsweise angezeigt durch: +
+
+    INFO | 09 08:37:17,663 | Thread-9 | 
+      MOASession 6576509775379152205 angelegt  
+     	
+    INFO | 09 08:37:20,828 | Thread-9 | 
+      Anmeldedaten zu MOASession 6576509775379152205 
+      angelegt, SAML Artifakt 
+      AAF/BrdRfnMaQVGIbP/Gf9OwDUwwsXChb7nuT+VXQzOoHbV
+    
+
+ +
+Die 1. Log-Meldung besagt, dass sich ein Benutzer an MOA-ID-AUTH angemeldet und eine eindeutige SessionID zugewiesen bekommen hat.
+Die 2. Log-Meldung informiert darüber, dass die Anmeldedaten des Benutzers unter dem angezeigten SAML Artifakt abgeholt werden können.
+
+Wenn nun versucht wird, eine Transaktion mit einer ungültigen SessionID fortzusetzen erhält man folgende Log-Meldung:
+
+    ERROR | 09 09:34:27,105 | Thread-8 | 
+	at.gv.egovernment.moa.id.AuthenticationException: 
+	MOASessionID ist unbekannt 
+	(MOASessionID=-8650403497547200032)
+
+

In diesem Fall gibt der mitgeloggte Stacktrace Auskunft + über die Art des Fehlers. Der Aufrufer der MOA ID + Webapplikation bekommt einen Fehlercode sowie eine kurze + Beschreibung des Fehlers als Antwort zurück.
+
+ Die Tatsächlich übertragenen Anfragen bzw. Antworten + werden aus Effizienzgründen nur im Log-Level DEBUG + angezeigt.

+
+

+

+

+
+
+

+ + + + + + +

+
+
© 2004
+
+
+ + +
+
+ -- cgit v1.2.3 From c6e7d0eb0d545b136cc64724010e6d9368a7974c Mon Sep 17 00:00:00 2001 From: pdanner Date: Tue, 28 Aug 2007 09:26:30 +0000 Subject: changed documentation of xalan/xerces dependency git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@967 d688527b-c9ab-4aba-bd8d-4036d912da1d --- id/server/doc/moa_id/id-admin_1.htm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'id/server/doc/moa_id/id-admin_1.htm') diff --git a/id/server/doc/moa_id/id-admin_1.htm b/id/server/doc/moa_id/id-admin_1.htm index 289c52d8a..d289f7929 100644 --- a/id/server/doc/moa_id/id-admin_1.htm +++ b/id/server/doc/moa_id/id-admin_1.htm @@ -229,13 +229,14 @@ Um MOA-ID-AUTH in Tomcat für den Ablauf vorzubereiten, sind folgende Schrit $CATALINA_HOME/common/endorsed kopieren werden. Folgende Libraries sind für das Deployment im endorsed Verzeichnis vorgesehen: Eventuell vorhandene Dateien mit dem gleichen Namen müssen ersetzt werden. Die ggf. in diesem Verzeichnis vorhandene Datei - xml-apis.jar muss gelöscht werden. + xmlParserAPIs.jar muss gelöscht werden.
  • Folgende Java System Properties sind zu setzen:
  • Diese Java System-Properties werden Tomcat über die Umgebungsvariable - CATALINA_OPTS mitgeteilt (siehe Deployment von MOA-ID-AUTH). + CATALINA_OPTS mitgeteilt (siehe Deployment von MOA-ID-AUTH moa-id-env.sh.txt).

    Beispiel-Skripts zum Setzen von CATALINA_OPTS und zum Starten diff --git a/id/server/doc/moa_id/id-admin_2.htm b/id/server/doc/moa_id/id-admin_2.htm index 647bd616e..12f71808d 100644 --- a/id/server/doc/moa_id/id-admin_2.htm +++ b/id/server/doc/moa_id/id-admin_2.htm @@ -124,7 +124,7 @@ Projekt moa 

    Konfiguration von MOA ID v.1.5

    Die Konfiguration von MOA ID wird mittels einer XML-basierten Konfigurationsdatei, die dem Schema - MOA-ID-Configuration-1.5.0.xsd entspricht, durchgeführt. + MOA-ID-Configuration-1.5.1.xsd entspricht, durchgeführt.

    Der Ort der Konfigurationsdatei wird im Abschnitt Deployment der Web-Applikation in Tomcat beschrieben.

    Enthält die Konfigurationsdatei relative Pfadangaben, werden @@ -227,32 +227,22 @@ Projekt moa  herangezogen, wenn in der Konfigurationsdatei weder globale (für alle Online-Applikationen gültig) noch lokale (Templates je Online-Applikation) spezifiziert sind. Hinweis: Die Template zur Anmeldung mit Online-Vollmachten können nicht über die URL angegeben werden.
    - Das Templates-Element hat die drei Kindelemente - BKUSelectionTemplate, Templateund OnlineMandates. Jedes dieser - drei Elemente kann genau einmal vorkommen oder fehlen. + Das Templates-Element hat die zwei Kindelemente + BKUSelectionTemplateund Template. Jedes dieser + zwei Elemente kann genau einmal vorkommen oder fehlen. Das Kindelement BKUSelectionTemplate spezifiziert ein Template zur Gestaltung der Seite "Auswahl der Bürgerkartenumgebung", während das Kindelement Template die Seite "Anmeldung mit Bürgerkarte" referenziert. Dies beiden Elemente haben genau ein Attribut namens URL, das die Lage des Templates im Form einer URL beschreibt. Relative Pfadangaben werden dabei relativ zum Verzeichnis, in dem sich die - MOA-ID Konfigurationsdatei befindet, interpretiert. Bei Templates die über das Protokoll https referenziert werden, muss vor dem Start des Tomcat ein Truststore angegeben werden, das die notwendigen vertrauenswürdigen Zertifikate enthält. Siehe dazu die Parameter in den vorbereiteten Startdateien startTomcat.bat und tomcat-start.sh.Das Kindeelement OnlineMandates referenziert Templates zur Gestaltung der Seite Online-Vollmachten Anmeldung. Hier kann BKU spezifisch ein MOA-ID Template (das beispielsweise Größenparameter für die verwendete BKU enthält) und ein Template zur Gestaltung der Seite für die Anmeldung mit Online-Vollmacht angegeben werden. Innerhalb dieses Templates wird in einem iFrame das angegebene MOA-ID Template aufgerufen. Für BKU URLs, die nicht konfiguriert sind wird dein Standard-Template verwendet. Im folgenden Beispiel werden drei Templates im Verzeichnis - CATALINA_HOME/conf/moa-id/templates referenziert:
    -

    -<Templates>
    -  <BKUSelectionTemplate URL="templates/SampleBKUSelectionTemplate.html"/>
    -  <Template URL="templates/SampleTemplate.html"/>
    -  <OnlineMandates>
    <BKU URL="https://www.handy-signatur.at/mobile/https-security-layer-request/default.aspx">
    <MOA-ID-Template URL="sampleTemplates/handy_moa-id_template.html"/>
    <MandateTemplate URL="sampleTemplates/handy_mandate_template.html"/>
    </BKU>
    <BKU URL="https://localhost:3496/https-security-layer-request">
    <MOA-ID-Template URL="sampleTemplates/local_moa-id_template.html"/>
    <MandateTemplate URL="sampleTemplates/local_mandate_template.html"/>
    </BKU>
    <BKU URL="https://[yourserver]/bkuonline/https-security-layer-request">
    <MOA-ID-Template URL="sampleTemplates/online_moa-id_template.html"/>
    <MandateTemplate URL="sampleTemplates/online_mandate_template.html"/>
    </BKU>
    </OnlineMandates> -</Templates>
    - -
    + MOA-ID Konfigurationsdatei befindet, interpretiert. Bei Templates die über das Protokoll https referenziert werden, muss vor dem Start des Tomcat ein Truststore angegeben werden, das die notwendigen vertrauenswürdigen Zertifikate enthält. Siehe dazu die Parameter in den vorbereiteten Startdateien startTomcat.bat und tomcat-start.sh.
    Richtlinien zur Struktur der Templates können der MOA-ID-Spezifikation bzw. dem Abschnitt Aufruf von MOA-ID-AUTH dieses Handbuches entnommen werden.

    -

    AuthComponent/SecurityLayer
    Das Element SecurityLayer enthält Parameter @@ -272,7 +262,7 @@ Projekt moa  relativ zur MOA-ID Konfigurationsdatei. Das Encoding dieser Datei muss UTF-8 sein.

    - Beispiel für + Beispiel für eine TransformsInfo-Datei

    AuthComponent/MOA-SP
    @@ -621,9 +611,9 @@ Hinweis: Um den Online-Vollmachten Modus für eine Online Applikation zu akt verwendet werden, um das Signatorzertifikat in die Anmeldedaten aufzunehmen. Alle Attribute sind optional und haben den Default-Wert - false. -
    - Anmerkung: Das Attribut provideStammzahl steht in keinem + false.
    + Das Attribut provideFullMandatorData bestimmt ob bei einer Vollmachten-Anmeldung die vollständigen Vollmacht in der SAML Assertion mitgegeben wird oder nur die Basisdaten wie Name, Geburtsdatum und bPK des Vertreters (bzw. Organwalter/PV) sowie Name, Geburtsdatum und bPK (bzw. Name und Stammzahl bei juristischen Personen) des Vertretenen in der Assertion übermittelt. Bei provideFullMandatorData=false werden nur die Basisdaten übermittelt (Defaulteinstellung). Bei provideFullMandatorData=true wird zusätzlich die gesamte Vollmacht übergeben.

    +

    Anmerkung: Das Attribut provideStammzahl steht in keinem Zusammenhang zum gleichnamigen Attribut VerifyInfoboxes/@provideStammzahl, das angibt ob die Stammzahl an eine Prüfapplikation weitergegeben @@ -632,11 +622,11 @@ Hinweis: Um den Online-Vollmachten Modus für eine Online Applikation zu akt Zusammenhang zum gleichnamigen Attribut VerifyInfoboxes/@provideIdentityLink, das angibt ob die Personenbindung an eine Prüfapplikation - weitergegeben werden soll. -
    -
    -

    -
    + weitergegeben werden soll. +
    +
    +

    +

    OnlineApplication/AuthComponent/IdentificationNumber
    Das wirtschaftsbereichsspezifische Personenkennzeichen (wbPK) @@ -717,7 +707,7 @@ Hinweis: Um den Online-Vollmachten Modus für eine Online Applikation zu akt Dieses Kindelement kann genau einmal vorkommen und entspricht in seiner Struktur dem Element AuthComponent/Templates. Es kann verwendet werden, um Templates zur Gestaltung der Seiten - "Auswahl der Bürgerkartenumgebung", "Anmeldung mit Bürgerkarte" sowie "Anmeldung mit Online-Vollmacht" individuell für + "Auswahl der Bürgerkartenumgebung" und "Anmeldung mit Bürgerkarte" individuell für eine Online-Applikation zu definieren. Die hier definierten Templates haben Priorität gegenüber globalen Templates und Templates, die in der aufrufenden URL übergeben werden. @@ -944,7 +934,7 @@ Hinweis: Um den Online-Vollmachten Modus für eine Online Applikation zu akt
    Das optionale Attribut configFileURL verweist auf eine Konfigurationsdatei die dem Schema - MOA-ID-Configuration-1.4.xsd + MOA-ID-Configuration-1.5.1.xsd entspricht mit Dokument-Element Configuration. Die Angabe erfolgt relativ zur verwendeten MOA-ID Konfigurationsdatei. Beispiel für das Element @@ -1211,7 +1201,7 @@ Der Name der Konfigurationsdatei wird in der Konfiguration von MOA-ID als Wert d wobei <realURLPrefix> dem Konfigurationswert OnlineApplication/ProxyComponent/ConnectionParameter/@URL entspricht.

    Die Konfigurationsdatei ist eine XML-Datei, die dem Schema -MOA-ID-Configuration-1.4.xsd mit dem Wurzelelement +MOA-ID-Configuration-1.5.1.xsd mit dem Wurzelelement Configuration entspricht.

    diff --git a/id/server/doc/moa_id/id-anwendung_1.htm b/id/server/doc/moa_id/id-anwendung_1.htm index 25c1d8674..28f7a5979 100644 --- a/id/server/doc/moa_id/id-anwendung_1.htm +++ b/id/server/doc/moa_id/id-anwendung_1.htm @@ -177,25 +177,8 @@ und es können zusätzliche Elemente darin aufgenommen werden.
    Auch dabei ist die vorgegebene Grundstruktur einzuhalten, die speziellen Tags <StartAuth> und <BKUSelect> sind verpflichtend.

    -

    Templates für Online-Vollmachten

    - Die Gestaltung der Seite für die Anmeldung mit Online-Vollmachten kann über zwei Templates angespasst werden.

    -

    Das Template für die Seite "Anmeldung mit Online-Vollmacht" von MOA-ID-AUTH kann aus folgender Grundstruktur aufgebaut werden:

    +

    Wichtiger Hinweis: wenn die Templates über HTTPS geladen werden sollten, so muss das SSL/TLS Zertifikat des Servers in einem Java Truststore gespeichert werden und dieser beim Start von Tomcat angegeben werden.

    -
    -<html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>Vollmachten-Anmeldung</title>
    <script language="javascript">
    function fillFrame() {
    var f = top.frames['mandate'];
    with (f.document) {
    open();
    <Mandate>
    close();
    }
    }
    </script>
    </head>
    <body onLoad="fillFrame(); return false;">
    <h2>Vollmachten-Anmeldung Template</h2>
    <iframe name="mandate" src="" frameborder="0" width="250" height="400" scrolling="no"></iframe>
    </body>
    </html>
    - -

    Innerhalb des Dokuments können Texte, Beschriftungen und Styles modifiziert werden, - und es können zusätzliche Elemente darin aufgenommen werden.
    -
    - Auch dabei ist die vorgegebene Grundstruktur einzuhalten, das spezielle Tags <Mandate> ist verpflichtend. - - Weiters ist verpflichtend ist der JavaScript Code, der Aufruf der fillFrame Funktion im body und das name Attribut des iframes.

    -
    -

    Weiters muss ein MOA-ID Template angegeben werden, das den Anforderungen des Templatefür die Anmeldeseite von MOA-ID-AUTH genügen muss (siehe oben). Zusätzlich zu beachten ist, dass im Header dieser MOA-ID Templates für die lokale BKU der Codeteil -

    <base target="_parent">
    - vorkommt. Fehlt dieser Teil so wird die Online-Applikation im iFrame des Template für die Seite "Anmeldung mit Online-Vollmacht" geöffnet (was im Allgemeinen nicht erwünscht ist).

    -

    Beispiele für diese MOA-ID Templates und die Templates für die Seite "Anmeldung mit Online-Vollmacht" sind in den Default-Konfigurationen vorhanden.

    -

    Wichtiger Hinweis: wenn die Templates über HTTPS geladen werden sollten, so muss das SSL/TLS Zertifikat des Servers in einem Java Truststore gespeichert werden und dieser beim Start von Tomcat angegeben werden.

    Vorgeschlagene Vorgehensweise:
    -- 
    cgit v1.2.3
    
    
    From a9b2e962d2853b74d314cb9f614cab446a7134c0 Mon Sep 17 00:00:00 2001
    From: kstranacher 
    Date: Thu, 26 Jan 2012 21:59:33 +0000
    Subject: * optionalen useUTC Parameter in Konfig eingefügt (damit IssueInstant
     in SAML Assertion auf UTC einstellbar) * optionalen sourceID Parameter bei
     MOA-ID Aufruf eingefügt (wird 1:1 in SAML Assertion übernommen) * Update Doku
     (useUTC, sourceID, Vollmachten-Profile) * Ablaufänderung bei
     Vollmachten-Modus (Signatur Zertifikat wird aus Signatur entnommen und nicht
     mittels eigenem Infobox-Request)
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@1233 d688527b-c9ab-4aba-bd8d-4036d912da1d
    ---
     .../at/gv/egovernment/moa/util/DateTimeUtils.java  |  83 +++++++++------
     .../schemas/MOA-ID-Configuration-1.5.1.xsd         |   9 +-
     .../gv/egovernment/moa/util/DateTimeUtilsTest.java |   2 +-
     id/readme_1.5.1.txt                                |   2 +
     .../conf/moa-id/SampleMOAIDConfiguration.xml       |   3 +-
     .../conf/moa-id/SampleMOAIDConfigurationProxy.xml  |   3 +-
     .../SampleMOAIDConfiguration_withTestBKs.xml       |   3 +-
     .../SampleMOAIDConfiguration_withTestBKsProxy.xml  |   3 +-
     id/server/doc/MOA-ID-Configuration-1.5.1.xsd       |   9 +-
     id/server/doc/MOA_ID_1.5_Anhang.pdf                | Bin 70517 -> 296723 bytes
     id/server/doc/moa_id/faqs.htm                      |   3 +-
     id/server/doc/moa_id/id-admin.htm                  |   2 +-
     id/server/doc/moa_id/id-admin_1.htm                |   2 +-
     id/server/doc/moa_id/id-admin_2.htm                |  10 +-
     id/server/doc/moa_id/id-admin_3.htm                |   2 +-
     id/server/doc/moa_id/id-anwendung.htm              |   2 +-
     id/server/doc/moa_id/id-anwendung_1.htm            |   8 +-
     id/server/doc/moa_id/id-anwendung_2.htm            |   3 +-
     id/server/doc/moa_id/links.htm                     |   3 +-
     id/server/doc/moa_id/moa.htm                       |   2 +-
     .../moa/id/auth/AuthenticationServer.java          |  59 +++++++----
     .../moa/id/auth/MOAIDAuthConstants.java            |   2 +
     .../builder/AuthenticationAssertionBuilder.java    |  26 +++++
     .../AuthenticationDataAssertionBuilder.java        |  15 ++-
     .../moa/id/auth/data/AuthenticationSession.java    |  28 +++++-
     .../auth/servlet/GetAuthenticationDataService.java |   9 +-
     .../auth/servlet/StartAuthenticationServlet.java   |  13 ++-
     .../servlet/VerifyAuthenticationBlockServlet.java  | 112 +++++++++++++++++++--
     .../id/auth/servlet/VerifyCertificateServlet.java  |  62 +-----------
     .../id/auth/servlet/VerifyIdentityLinkServlet.java |   2 +-
     .../moa/id/config/ConfigurationBuilder.java        |   1 +
     .../moa/id/config/auth/OAAuthParameter.java        |  21 ++++
     .../moa/id/data/AuthenticationData.java            |  15 +++
     .../moa/id/proxy/builder/SAMLRequestBuilder.java   |   2 +-
     .../moa/id/util/ParamValidatorUtils.java           |  30 ++++++
     .../id/util/client/mis/simple/MISSimpleClient.java |  19 +++-
     .../test/abnahme/A/Test100StartAuthentication.java |  16 +--
     .../test/abnahme/A/Test300VerifyAuthBlock.java     |   4 +-
     .../A/Test600GetAuthenticationDataService.java     |   2 +-
     .../test/java/test/abnahme/AbnahmeTestCase.java    |   2 +-
     .../moa/id/auth/AuthenticationServerTest.java      |   2 +-
     41 files changed, 421 insertions(+), 175 deletions(-)
    
    (limited to 'id/server/doc/moa_id/id-admin_1.htm')
    
    diff --git a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java
    index 92e845967..d70073db8 100644
    --- a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java
    +++ b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java
    @@ -26,6 +26,7 @@ package at.gv.egovernment.moa.util;
     
     import java.io.StringWriter;
     import java.text.ParseException;
    +import java.text.SimpleDateFormat;
     import java.util.Calendar;
     import java.util.Date;
     import java.util.GregorianCalendar;
    @@ -48,38 +49,56 @@ public class DateTimeUtils {
        * @param cal the Calendar value
        * @return the dateTime value
        */
    -  public static String buildDateTime(Calendar cal) {
    -    StringWriter out = new StringWriter();
    -    out.write("" + cal.get(Calendar.YEAR));
    -    out.write("-");
    -    out.write(to2DigitString(cal.get(Calendar.MONTH) + 1));
    -    out.write("-");
    -    out.write(to2DigitString(cal.get(Calendar.DAY_OF_MONTH)));
    -    out.write("T");
    -    out.write(to2DigitString(cal.get(Calendar.HOUR_OF_DAY)));
    -    out.write(":");
    -    out.write(to2DigitString(cal.get(Calendar.MINUTE)));
    -    out.write(":");
    -    out.write(to2DigitString(cal.get(Calendar.SECOND)));
    -    int tzOffsetMilliseconds =
    -      cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
    -    if (tzOffsetMilliseconds != 0) {
    -      int tzOffsetMinutes = tzOffsetMilliseconds / (1000 * 60);
    -      int tzOffsetHours = tzOffsetMinutes / 60;
    -      tzOffsetMinutes -= tzOffsetHours * 60;
    -      if (tzOffsetMilliseconds > 0) {
    -        out.write("+");
    -        out.write(to2DigitString(tzOffsetHours));
    -        out.write(":");
    -        out.write(to2DigitString(tzOffsetMinutes));
    -      } else {
    -        out.write("-");
    -        out.write(to2DigitString(-tzOffsetHours));
    -        out.write(":");
    -        out.write(to2DigitString(-tzOffsetMinutes));
    -      }
    -    }
    -    return out.toString();
    +  public static String buildDateTime(Calendar cal, boolean useUTC) {
    +	  
    +	  if (useUTC)
    +		  return buildDateTimeUTC(cal);
    +	  else {
    +	    StringWriter out = new StringWriter();
    +	    out.write("" + cal.get(Calendar.YEAR));
    +	    out.write("-");
    +	    out.write(to2DigitString(cal.get(Calendar.MONTH) + 1));
    +	    out.write("-");
    +	    out.write(to2DigitString(cal.get(Calendar.DAY_OF_MONTH)));
    +	    out.write("T");
    +	    out.write(to2DigitString(cal.get(Calendar.HOUR_OF_DAY)));
    +	    out.write(":");
    +	    out.write(to2DigitString(cal.get(Calendar.MINUTE)));
    +	    out.write(":");
    +	    out.write(to2DigitString(cal.get(Calendar.SECOND)));
    +	    int tzOffsetMilliseconds =
    +	      cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
    +	    if (tzOffsetMilliseconds != 0) {
    +	      int tzOffsetMinutes = tzOffsetMilliseconds / (1000 * 60);
    +	      int tzOffsetHours = tzOffsetMinutes / 60;
    +	      tzOffsetMinutes -= tzOffsetHours * 60;
    +	      if (tzOffsetMilliseconds > 0) {
    +	        out.write("+");
    +	        out.write(to2DigitString(tzOffsetHours));
    +	        out.write(":");
    +	        out.write(to2DigitString(tzOffsetMinutes));
    +	      } else {
    +	        out.write("-");
    +	        out.write(to2DigitString(-tzOffsetHours));
    +	        out.write(":");
    +	        out.write(to2DigitString(-tzOffsetMinutes));
    +	      }
    +	    }
    +	    return out.toString();
    +	  }
    +  }
    +  
    +  /**
    +   * Builds a dateTime value in UTC from a Calendar value.
    +   * @param cal the Calendar value
    +   * @return the dateTime value
    +   */
    +  public static String buildDateTimeUTC(Calendar cal) {
    +    
    +	  SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
    +	  f.setTimeZone(TimeZone.getTimeZone("UTC"));
    +	  
    +	  return f.format(cal.getTime());		
       }
       
       /**
    diff --git a/common/src/main/resources/resources/schemas/MOA-ID-Configuration-1.5.1.xsd b/common/src/main/resources/resources/schemas/MOA-ID-Configuration-1.5.1.xsd
    index cc562187a..d16953eab 100644
    --- a/common/src/main/resources/resources/schemas/MOA-ID-Configuration-1.5.1.xsd
    +++ b/common/src/main/resources/resources/schemas/MOA-ID-Configuration-1.5.1.xsd
    @@ -89,10 +89,16 @@
     	
     		
     			
    -				
    +				
     					
     						enthält Parameter der Authentisierungs-Komponente
     					
    +					
    +						
    +															
    +							
    +						
    +					
     				
     				
     					
    @@ -467,6 +473,7 @@
     					
     					
     					
    +					
     					
     				
     			
    diff --git a/common/src/test/java/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java b/common/src/test/java/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java
    index 8fdd389a2..3364e9888 100644
    --- a/common/src/test/java/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java
    +++ b/common/src/test/java/test/at/gv/egovernment/moa/util/DateTimeUtilsTest.java
    @@ -121,7 +121,7 @@ public class DateTimeUtilsTest extends TestCase {
       	Calendar cal = new GregorianCalendar(TimeZone.getTimeZone(timeZone));
       	cal.set(year,month, day, hour, min, sec);
       	cal.set(Calendar.MILLISECOND, 0);
    -  	String dateTimeBuilt = DateTimeUtils.buildDateTime(cal);
    +  	String dateTimeBuilt = DateTimeUtils.buildDateTime(cal, false);
       	assertEquals(dateTimeShould, dateTimeBuilt);
       }
     
    diff --git a/id/readme_1.5.1.txt b/id/readme_1.5.1.txt
    index 8cf5e7361..e742212df 100644
    --- a/id/readme_1.5.1.txt
    +++ b/id/readme_1.5.1.txt
    @@ -17,6 +17,8 @@ gleichen Verzeichnis):
     - Änderung der Konfiguration 
     	- für Online-Vollmachten
     	- Fixer Target-Parameter für Online-Applikation konfigurierbar
    +	- Optionaler Parameter zur Angabe der IssueInstant im UTC Format in der SAML-Assertion
    +- Weiterer optionaler Parameter sourceID beim MOA-ID Aufruf
     - IAIK Libraries aktualisiert:
     	iaik-moa:           Version 1.31	
     
    diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml
    index 697cadec4..6525642f1 100644
    --- a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml
    +++ b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration.xml
    @@ -65,7 +65,8 @@
     			
     			
     			
    -			
    +			
    +			
     			
     			
     		
    diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml
    index 41103cf3c..27bf6681c 100644
    --- a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml
    +++ b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfigurationProxy.xml
    @@ -76,7 +76,8 @@
     			
     			
     			
    -			
    +			
    +			
     			
     			
     		
    diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml
    index 05c6387e1..eefc7cf6a 100644
    --- a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml
    +++ b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKs.xml
    @@ -67,7 +67,8 @@
     			
     			
     			
    -			
    +			
    +			
     			
     			
     		
    diff --git a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml
    index 1d8b50537..f9e296c62 100644
    --- a/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml
    +++ b/id/server/data/deploy/conf/moa-id/SampleMOAIDConfiguration_withTestBKsProxy.xml
    @@ -77,7 +77,8 @@
     			
     			
     			
    -			
    +			
    +			
     			
     			
     		
    diff --git a/id/server/doc/MOA-ID-Configuration-1.5.1.xsd b/id/server/doc/MOA-ID-Configuration-1.5.1.xsd
    index cc562187a..d16953eab 100644
    --- a/id/server/doc/MOA-ID-Configuration-1.5.1.xsd
    +++ b/id/server/doc/MOA-ID-Configuration-1.5.1.xsd
    @@ -89,10 +89,16 @@
     	
     		
     			
    -				
    +				
     					
     						enthält Parameter der Authentisierungs-Komponente
     					
    +					
    +						
    +															
    +							
    +						
    +					
     				
     				
     					
    @@ -467,6 +473,7 @@
     					
     					
     					
    +					
     					
     				
     			
    diff --git a/id/server/doc/MOA_ID_1.5_Anhang.pdf b/id/server/doc/MOA_ID_1.5_Anhang.pdf
    index 454ff933a..f2e5057c7 100644
    Binary files a/id/server/doc/MOA_ID_1.5_Anhang.pdf and b/id/server/doc/MOA_ID_1.5_Anhang.pdf differ
    diff --git a/id/server/doc/moa_id/faqs.htm b/id/server/doc/moa_id/faqs.htm
    index 0b9ef0415..814d0c9f7 100644
    --- a/id/server/doc/moa_id/faqs.htm
    +++ b/id/server/doc/moa_id/faqs.htm
    @@ -207,8 +207,7 @@ MOA ist eine Entwicklung des Bundesrechenzentrums BRZ in Zusammenarbeit mit A-Tr
           
           
             
    -
    © 2003
    - +
    © 2012

    diff --git a/id/server/doc/moa_id/id-admin.htm b/id/server/doc/moa_id/id-admin.htm index 7192f02e2..7d014299e 100644 --- a/id/server/doc/moa_id/id-admin.htm +++ b/id/server/doc/moa_id/id-admin.htm @@ -311,7 +311,7 @@ Die Versionsangaben beziehen sich auf die Versionen, mit denen die MOA ID Webapp

    -
    © 2004
    +
    © 2012

    diff --git a/id/server/doc/moa_id/id-admin_1.htm b/id/server/doc/moa_id/id-admin_1.htm index 9b18fcdbe..08a1acc73 100644 --- a/id/server/doc/moa_id/id-admin_1.htm +++ b/id/server/doc/moa_id/id-admin_1.htm @@ -539,7 +539,7 @@ Wenn nun versucht wird, eine Transaktion mit einer ungültigen SessionID fort

    -
    © 2010
    +
    © 2012

    diff --git a/id/server/doc/moa_id/id-admin_2.htm b/id/server/doc/moa_id/id-admin_2.htm index ea4874edd..8a217bfcc 100644 --- a/id/server/doc/moa_id/id-admin_2.htm +++ b/id/server/doc/moa_id/id-admin_2.htm @@ -613,8 +613,9 @@ Hinweis: Um den Online-Vollmachten Modus für eine Online Applikation zu akt Anmeldedaten aufzunehmen. Alle Attribute sind optional und haben den Default-Wert false.
    - Das Attribut provideFullMandatorData bestimmt ob bei einer Vollmachten-Anmeldung die vollständigen Vollmacht in der SAML Assertion mitgegeben wird oder nur die Basisdaten wie Name, Geburtsdatum und bPK des Vertreters (bzw. Organwalter/PV) sowie Name, Geburtsdatum und bPK (bzw. Name und Stammzahl bei juristischen Personen) des Vertretenen in der Assertion übermittelt. Bei provideFullMandatorData=false werden nur die Basisdaten übermittelt (Defaulteinstellung). Bei provideFullMandatorData=true wird zusätzlich die gesamte Vollmacht übergeben.

    -

    Anmerkung: Das Attribut provideStammzahl steht in keinem + Das Attribut provideFullMandatorData bestimmt ob bei einer Vollmachten-Anmeldung die vollständigen Vollmacht in der SAML Assertion mitgegeben wird oder nur die Basisdaten wie Name, Geburtsdatum und bPK des Vertreters (bzw. Organwalter/PV) sowie Name, Geburtsdatum und bPK (bzw. Name und Stammzahl bei juristischen Personen) des Vertretenen in der Assertion übermittelt. Bei provideFullMandatorData=false werden nur die Basisdaten übermittelt (Defaulteinstellung). Bei provideFullMandatorData=true wird zusätzlich die gesamte Vollmacht übergeben.
    + Das Attribut useUTC bestimmt ob IssueInstant in der SAML Assertion als UTC (2012-01-26T18:38:35Z, useUTC=true) oder dem Default-Format (z.B.: 2012-01-26T19:38:35+01:00, useUTC=false) angegeben wird.

    +

    Anmerkung: Das Attribut provideStammzahl steht in keinem Zusammenhang zum gleichnamigen Attribut VerifyInfoboxes/@provideStammzahl, das angibt ob die Stammzahl an eine Prüfapplikation weitergegeben @@ -921,7 +922,8 @@ Hinweis: Um den Online-Vollmachten Modus für eine Online Applikation zu akt
    Mit Hilfe dieses Elements werden die Online-Vollmachten für die Online-Applikation aktiviert. Als Kindelement muss Profiles angegeben werden. Dieses Element beinhaltet eine (Komma-separierte) - Liste von Vollmachten-Identifikatoren, die festlegen mit welchen Vollmachtstypen man sich bei der Online-Applikation anmelden kann.
    + Liste von Vollmachten-Profilen, die festlegen mit welchen Vollmachtstypen man sich bei der Online-Applikation anmelden kann. + Unter https://vollmachten.stammzahlenregister.gv.at/mis/ finden Sie eine Liste der unterstützen Vollmachten-Profile.
    Hinweis: Hierzu muss auch die Verbindung zum Online-Vollmachten Service konfiguriert werden - siehe hier

    @@ -1453,7 +1455,7 @@ Im Falle einer fehlerhaften neuen Konfiguration wird die ursprüngliche Konf

    -
    © 2010
    +
    © 2012

    diff --git a/id/server/doc/moa_id/id-admin_3.htm b/id/server/doc/moa_id/id-admin_3.htm index 8b1c74e7c..5b95feca8 100644 --- a/id/server/doc/moa_id/id-admin_3.htm +++ b/id/server/doc/moa_id/id-admin_3.htm @@ -194,7 +194,7 @@ Um das Logging in die Datenbank Log4j bekannt zu machen, muss die Log4j-Konfigur

    -
    © 2004
    +
    © 2012

    diff --git a/id/server/doc/moa_id/id-anwendung.htm b/id/server/doc/moa_id/id-anwendung.htm index d5057f854..c4cab64e1 100644 --- a/id/server/doc/moa_id/id-anwendung.htm +++ b/id/server/doc/moa_id/id-anwendung.htm @@ -94,7 +94,7 @@ Dies kann unter Mithilfe der Webapplikation MOA-ID-PROXY geschehen, die für

    -
    © 2003
    +
    © 2012

    diff --git a/id/server/doc/moa_id/id-anwendung_1.htm b/id/server/doc/moa_id/id-anwendung_1.htm index 28f7a5979..ad45ff7e1 100644 --- a/id/server/doc/moa_id/id-anwendung_1.htm +++ b/id/server/doc/moa_id/id-anwendung_1.htm @@ -73,7 +73,7 @@ Projekt moa  Der Aufruf erfolgt durch einen Verweis der Form:
    <a href="https://<moa-id-server-und-pfad>/
     StartAuthentication?Target=<geschäftsbereich>
    -&OA=<oa-url>&Template=<template-url>&useMandate=false">
    +&OA=<oa-url>&Template=<template-url>&useMandate=false&sourceID=<sourceID>"> @@ -92,6 +92,10 @@ StartAuthentication?Target=<geschäftsbereich> + + + +
    <moa-id-server-und-pfad>Server und Pfad, wo MOA-ID-AUTH installiert istuseMandate=<true/false> optional; Gibt an ob eine Anmeldung im Online-Vollmachten-Modus durchgeführt werden soll (=true) oder nicht (=false);
    sourceID=<sourceID>optional; Gibt eine sourceID an, die (wenn sie gesetzt ist) in der SAML-Assertion aufscheint


    @@ -204,7 +208,7 @@ Im folgenden Beispiel wird in den Java Truststore "truststore.jks" mit

    -
    © 2004
    +
    © 2012

    diff --git a/id/server/doc/moa_id/id-anwendung_2.htm b/id/server/doc/moa_id/id-anwendung_2.htm index df8b10aad..4e2e89d74 100644 --- a/id/server/doc/moa_id/id-anwendung_2.htm +++ b/id/server/doc/moa_id/id-anwendung_2.htm @@ -237,8 +237,7 @@ Falls nötig, kann eine ma

    -
    © 2003
    - +
    © 2012

    diff --git a/id/server/doc/moa_id/links.htm b/id/server/doc/moa_id/links.htm index ef6c09083..2956c6263 100644 --- a/id/server/doc/moa_id/links.htm +++ b/id/server/doc/moa_id/links.htm @@ -134,8 +134,7 @@ MOA ist eine Entwicklung des Bundesrechenzentrums BRZ in Zusammenarbeit mit A-Tr

    -
    © 2010 -
    +
    © 2012

    diff --git a/id/server/doc/moa_id/moa.htm b/id/server/doc/moa_id/moa.htm index 94f4a35ea..09fb1c5b6 100644 --- a/id/server/doc/moa_id/moa.htm +++ b/id/server/doc/moa_id/moa.htm @@ -247,7 +247,7 @@ an den Benutzer weitergeleitet und die Anfragen des Benutzers an die OA weiterge

    -
    © 2010
    +
    © 2012

    diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index 68e6b950a..a68dca65a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -24,11 +24,15 @@ package at.gv.egovernment.moa.id.auth; +import iaik.ixsil.exceptions.UtilsException; +import iaik.ixsil.util.Utils; import iaik.pki.PKIException; import iaik.x509.X509Certificate; import java.io.ByteArrayInputStream; import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.security.GeneralSecurityException; import java.security.Principal; @@ -49,7 +53,6 @@ import org.apache.xpath.XPathAPI; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import at.gv.egovernment.moa.id.AuthenticationException; @@ -114,7 +117,6 @@ import at.gv.egovernment.moa.util.DOMUtils; import at.gv.egovernment.moa.util.DateTimeUtils; import at.gv.egovernment.moa.util.FileUtils; import at.gv.egovernment.moa.util.StringUtils; -import at.gv.egovernment.moa.util.XPathUtils; /** @@ -305,7 +307,8 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @param useMandate Indicates if mandate is used or not * @param templateURL URL providing an HTML template for the HTML form generated * @param templateMandteURL URL providing an HTML template for the HTML form generated (for signing in mandates mode) - * @param scheme determines the protocol used + * @param scheme determines the protocol used + * @param sourceID * @return HTML form * @throws AuthenticationException * @see GetIdentityLinkFormBuilder @@ -320,7 +323,8 @@ public class AuthenticationServer implements MOAIDAuthConstants { String bkuURL, String useMandate, String sessionID, - String scheme) + String scheme, + String sourceID) throws WrongParametersException, AuthenticationException, ConfigurationException, BuildException { String useMandateString = null; @@ -381,7 +385,9 @@ public class AuthenticationServer implements MOAIDAuthConstants { session.setPublicOAURLPrefix(oaParam.getPublicURLPrefix()); session.setAuthURL(authURL); session.setTemplateURL(templateURL); - session.setBusinessService(oaParam.getBusinessService()); + session.setBusinessService(oaParam.getBusinessService()); + if (sourceID != null) + session.setSourceID(sourceID); } // BKU URL has not been set yet, even if session already exists if (bkuURL == null) { @@ -510,17 +516,16 @@ public class AuthenticationServer implements MOAIDAuthConstants { } // for testing new identity link certificate - // https://localhost:8443/moa-id-auth/StartAuthentication?Target=AR&OA=https://localhost:8443/TestMOAID_OA/LoginServletExample // xmlInfoboxReadResponse = null; // try { -// File file = new File("c:/temp/xxxMuster-new-cert_infobox.xml"); +// File file = new File("c:/temp/XXXMuster.xml"); // FileInputStream fis; // // fis = new FileInputStream(file); // byte[] array = Utils.readFromInputStream(fis); // // xmlInfoboxReadResponse = new String(array); -// //System.out.println(xmlInfoboxReadResponse); +// System.out.println(xmlInfoboxReadResponse); // // } catch (FileNotFoundException e) { // // TODO Auto-generated catch block @@ -529,7 +534,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { // // TODO Auto-generated catch block // e.printStackTrace(); // } -// + // parses the @@ -687,7 +692,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { // builds the AUTH-block - String authBlock = buildAuthenticationBlock(session); + String authBlock = buildAuthenticationBlock(session, oaParam); // session.setAuthBlock(authBlock); // builds the @@ -871,14 +876,14 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws BuildException If an error occurs on serializing an extended SAML attribute * to be appended to the AUTH-Block. */ - private String buildAuthenticationBlock(AuthenticationSession session) throws BuildException { + private String buildAuthenticationBlock(AuthenticationSession session, OAAuthParameter oaParam) throws BuildException { IdentityLink identityLink = session.getIdentityLink(); String issuer = identityLink.getName(); String gebDat = identityLink.getDateOfBirth(); String identificationValue = identityLink.getIdentificationValue(); String identificationType = identityLink.getIdentificationType(); - String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance()); + String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance(), oaParam.getUseUTC()); session.setIssueInstant(issueInstant); String authURL = session.getAuthURL(); String target = session.getTarget(); @@ -1418,6 +1423,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { // parses CreateXMLSignatureResponse csresp = new CreateXMLSignatureResponseParser(xmlCreateXMLSignatureReadResponse).parseResponse(); + try { String serializedAssertion = DOMUtils.serializeNode(csresp.getSamlAssertion()); session.setAuthBlock(serializedAssertion); @@ -1502,12 +1508,21 @@ public class AuthenticationServer implements MOAIDAuthConstants { } } + OAAuthParameter oaParam = + AuthConfigurationProvider.getInstance().getOnlineApplicationParameter( + session.getPublicOAURLPrefix()); + boolean useUTC = oaParam.getUseUTC(); // builds authentication data and stores it together with a SAML artifact - AuthenticationData authData = buildAuthenticationData(session, vsresp); + AuthenticationData authData = buildAuthenticationData(session, vsresp, useUTC); if (session.getUseMandate()) { // mandate mode + //session.setAssertionAuthBlock(assertionAuthBlock) + + // set signer certificate + session.setSignerCertificate(vsresp.getX509certificate()); + return null; } else { @@ -1521,6 +1536,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { session.getBkuURL(), session.getAssertionSignerCertificateBase64(), session.getAssertionBusinessService(), + session.getSourceID(), session.getExtendedSAMLAttributesOA()); authData.setSamlAssertion(samlAssertion); @@ -1677,6 +1693,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { session.getBkuURL(), session.getAssertionSignerCertificateBase64(), session.getAssertionBusinessService(), + session.getSourceID(), session.getExtendedSAMLAttributesOA()); authData.setSamlAssertion(samlAssertion); @@ -1772,9 +1789,14 @@ public class AuthenticationServer implements MOAIDAuthConstants { } VerifyXMLSignatureResponse vsresp = new VerifyXMLSignatureResponse(); - X509Certificate cert = session.getForeignSignerCertificate(); + X509Certificate cert = session.getSignerCertificate(); vsresp.setX509certificate(cert); - AuthenticationData authData = buildAuthenticationData(session, vsresp); + + OAAuthParameter oaParam = + AuthConfigurationProvider.getInstance().getOnlineApplicationParameter( + session.getPublicOAURLPrefix()); + boolean useUTC = oaParam.getUseUTC(); + AuthenticationData authData = buildAuthenticationData(session, vsresp, useUTC); String samlAssertion = @@ -1786,6 +1808,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { session.getBkuURL(), session.getAssertionSignerCertificateBase64(), session.getAssertionBusinessService(), + session.getSourceID(), session.getExtendedSAMLAttributesOA()); authData.setSamlAssertion(samlAssertion); @@ -1823,7 +1846,8 @@ public class AuthenticationServer implements MOAIDAuthConstants { */ private AuthenticationData buildAuthenticationData( AuthenticationSession session, - VerifyXMLSignatureResponse verifyXMLSigResp) + VerifyXMLSignatureResponse verifyXMLSigResp, + boolean useUTC) throws ConfigurationException, BuildException { IdentityLink identityLink = session.getIdentityLink(); @@ -1836,7 +1860,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { authData.setMinorVersion(0); authData.setAssertionID(Random.nextRandom()); authData.setIssuer(session.getAuthURL()); - authData.setIssueInstant(DateTimeUtils.buildDateTime(Calendar.getInstance())); + authData.setIssueInstant(DateTimeUtils.buildDateTime(Calendar.getInstance(), useUTC)); authData.setIdentificationType(identityLink.getIdentificationType()); authData.setGivenName(identityLink.getGivenName()); authData.setFamilyName(identityLink.getFamilyName()); @@ -1845,6 +1869,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { authData.setPublicAuthority(verifyXMLSigResp.isPublicAuthority()); authData.setPublicAuthorityCode(verifyXMLSigResp.getPublicAuthorityCode()); authData.setBkuURL(session.getBkuURL()); + authData.setUseUTC(oaParam.getUseUTC()); boolean provideStammzahl = oaParam.getProvideStammzahl(); if (provideStammzahl) { authData.setIdentificationValue(identityLink.getIdentificationValue()); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java index 260b3fd01..f3be98ef0 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java @@ -43,6 +43,8 @@ public interface MOAIDAuthConstants { public static final String PARAM_OA = "OA"; /** servlet parameter "bkuURI" */ public static final String PARAM_BKU = "bkuURI"; + /** servlet parameter "sourceID" */ + public static final String PARAM_SOURCEID = "sourceID"; /** servlet parameter "BKUSelectionTemplate" */ public static final String PARAM_BKUTEMPLATE = "BKUSelectionTemplate"; /** servlet parameter "BKUSelectionTemplate" */ diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java index 8af4e3af5..410d045f0 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationAssertionBuilder.java @@ -57,6 +57,11 @@ public class AuthenticationAssertionBuilder { " " + NL + " {2}" + NL + " "+ NL; + + protected static String SAML_ATTRIBUTE_NO_NAMESPACE = + " " + NL + + " {1}" + NL + + " "+ NL; /** * Empty constructor @@ -108,5 +113,26 @@ public class AuthenticationAssertionBuilder { } return sb.toString(); } + + /** + * Builds the SAML attributes to be appended to the AUTHBlock or to the SAML assertion + * delivered to the online application. + * The method traverses through the list of given SAML attribute objects and builds an + * XML structure (String representation) for each of the attributes. + * + * @param extendedSAMLAttributes The SAML attributes to be appended to the AUTHBlock or + * to the SAML assertion delivered to the online application. + * @return A string representation including the XML structures of + * the SAML attributes. + * + * @throws ParseException If an error occurs on serializing an SAML attribute. + */ + protected String buildSourceIDSAMLAttributes(String sourceID) throws ParseException { + StringBuffer sb = new StringBuffer(); + if (sourceID!=null) + sb.append(MessageFormat.format( SAML_ATTRIBUTE_NO_NAMESPACE, new Object[] {"SourceID", sourceID})); + + return sb.toString(); + } } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java index 367116c73..7032e09eb 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataAssertionBuilder.java @@ -69,9 +69,10 @@ public class AuthenticationDataAssertionBuilder extends AuthenticationAssertionB " " + NL + " {9}" + NL + " " + NL + - "{10}" + - "{11}" + + "{10}" + + "{11}" + "{12}" + + "{13}" + " " + NL + ""; @@ -103,9 +104,10 @@ public class AuthenticationDataAssertionBuilder extends AuthenticationAssertionB " " + NL + " {10}" + NL + " " + NL + - "{11}" + - "{12}" + + "{11}" + + "{12}" + "{13}" + + "{14}" + " " + NL + ""; /** @@ -156,6 +158,7 @@ public class AuthenticationDataAssertionBuilder extends AuthenticationAssertionB String bkuURL, String signerCertificateBase64, boolean businessService, + String sourceID, List extendedSAMLAttributes) throws BuildException { @@ -195,6 +198,7 @@ public class AuthenticationDataAssertionBuilder extends AuthenticationAssertionB String assertion; try { + assertion = MessageFormat.format(AUTH_DATA, new Object[] { authData.getAssertionID(), authData.getIssuer(), @@ -206,6 +210,7 @@ public class AuthenticationDataAssertionBuilder extends AuthenticationAssertionB StringUtils.removeXMLDeclaration(xmlPersonData), isQualifiedCertificate, bkuURL, + buildSourceIDSAMLAttributes(sourceID), publicAuthorityAttribute, signerCertificateAttribute, buildExtendedSAMLAttributes(extendedSAMLAttributes)}); @@ -244,6 +249,7 @@ public class AuthenticationDataAssertionBuilder extends AuthenticationAssertionB String bkuURL, String signerCertificateBase64, boolean businessService, + String sourceID, List extendedSAMLAttributes) throws BuildException { @@ -295,6 +301,7 @@ public class AuthenticationDataAssertionBuilder extends AuthenticationAssertionB StringUtils.removeXMLDeclaration(xmlMandateData), isQualifiedCertificate, bkuURL, + buildSourceIDSAMLAttributes(sourceID), publicAuthorityAttribute, signerCertificateAttribute, buildExtendedSAMLAttributes(extendedSAMLAttributes)}); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java index 3ab8ff819..5a18b720b 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java @@ -62,6 +62,11 @@ public class AuthenticationSession { * Friendly name for the target, if target is configured via MOA-ID configuration */ private String targetFriendlyName; + + /** + * SourceID + */ + private String sourceID; /** * Indicates if target from configuration is used or not */ @@ -155,7 +160,7 @@ public class AuthenticationSession { private boolean businessService; /** - * Signer certificate of the foreign citizen + * Signer certificate of the foreign citizen or for mandate mode */ private X509Certificate signerCertificate; /** @@ -212,11 +217,11 @@ public class AuthenticationSession { infoboxValidators = new ArrayList(); } - public X509Certificate getForeignSignerCertificate() { + public X509Certificate getSignerCertificate() { return signerCertificate; } - public void setForeignSignerCertificate(X509Certificate signerCertificate) { + public void setSignerCertificate(X509Certificate signerCertificate) { this.signerCertificate = signerCertificate; } @@ -284,6 +289,14 @@ public class AuthenticationSession { return target; } + /** + * Returns the sourceID. + * @return String + */ + public String getSourceID() { + return sourceID; + } + /** * Returns the target friendly name. * @return String @@ -332,6 +345,15 @@ public class AuthenticationSession { this.target = target; } } + + /** + * Sets the sourceID + * @param sourceID The sourceID to set + */ + public void setSourceID(String sourceID) { + this.sourceID = sourceID; + } + /** * Sets the target. If the target includes the target prefix, the prefix will be stripped off. * @param target The target to set diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java index da5ad6ab9..b5c72ef9f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetAuthenticationDataService.java @@ -87,6 +87,7 @@ public class GetAuthenticationDataService implements Constants { String statusMessageCode = null; String statusMessage = null; String samlAssertion = ""; + boolean useUTC = false; if (requests.length > 1) { // more than 1 request given as parameter statusCode = "samlp:Requester"; @@ -113,8 +114,11 @@ public class GetAuthenticationDataService implements Constants { requestID = request.getAttribute("RequestID"); String samlArtifact = DOMUtils.getText(samlArtifactElem); try { + AuthenticationData authData = AuthenticationServer.getInstance(). getAuthenticationData(samlArtifact); + + useUTC = authData.getUseUTC(); // success samlAssertion = authData.getSamlAssertion(); statusCode = "samlp:Success"; @@ -135,12 +139,13 @@ public class GetAuthenticationDataService implements Constants { } } try { - String responseID = Random.nextRandom(); - String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance()); + String responseID = Random.nextRandom(); + String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance(), useUTC); if (statusMessage == null) statusMessage = MOAIDMessageProvider.getInstance().getMessage(statusMessageCode, null); responses[0] = new SAMLResponseBuilder().build( responseID, requestID, issueInstant, statusCode, subStatusCode, statusMessage, samlAssertion); + } catch (MOAIDException e) { AxisFault fault = AxisFault.makeFault(e); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java index ca3883dad..431af3c31 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/StartAuthenticationServlet.java @@ -79,21 +79,22 @@ public class StartAuthenticationServlet extends AuthServlet { authURL = authURL.concat(req.getContextPath() + "/"); String target = req.getParameter(PARAM_TARGET); + String sourceID = req.getParameter(PARAM_SOURCEID); String oaURL = req.getParameter(PARAM_OA); String bkuURL = req.getParameter(PARAM_BKU); String templateURL = req.getParameter(PARAM_TEMPLATE); String sessionID = req.getParameter(PARAM_SESSIONID); String useMandate = req.getParameter(PARAM_USEMANDATE); - // escape parameter strings target = StringEscapeUtils.escapeHtml(target); + sourceID = StringEscapeUtils.escapeHtml(sourceID); oaURL = StringEscapeUtils.escapeHtml(oaURL); bkuURL = StringEscapeUtils.escapeHtml(bkuURL); templateURL = StringEscapeUtils.escapeHtml(templateURL); sessionID = StringEscapeUtils.escapeHtml(sessionID); useMandate = StringEscapeUtils.escapeHtml(useMandate); - + resp.setHeader(HEADER_EXPIRES,HEADER_VALUE_EXPIRES); resp.setHeader(HEADER_PRAGMA,HEADER_VALUE_PRAGMA); resp.setHeader(HEADER_CACHE_CONTROL,HEADER_VALUE_CACHE_CONTROL); @@ -111,7 +112,9 @@ public class StartAuthenticationServlet extends AuthServlet { if (!ParamValidatorUtils.isValidSessionID(sessionID)) throw new WrongParametersException("StartAuthentication", PARAM_SESSIONID, "auth.12"); if (!ParamValidatorUtils.isValidUseMandate(useMandate)) - throw new WrongParametersException("StartAuthentication", PARAM_USEMANDATE, "auth.12"); + throw new WrongParametersException("StartAuthentication", PARAM_USEMANDATE, "auth.12"); + if (!ParamValidatorUtils.isValidSourceID(sourceID)) + throw new WrongParametersException("StartAuthentication", PARAM_SOURCEID, "auth.12"); OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(oaURL); @@ -130,11 +133,11 @@ public class StartAuthenticationServlet extends AuthServlet { if (!ParamValidatorUtils.isValidTarget(target)) throw new WrongParametersException("StartAuthentication", PARAM_TARGET, "auth.12"); - getIdentityLinkForm = AuthenticationServer.getInstance().startAuthentication(authURL, target, null, oaURL, templateURL, bkuURL, useMandate, sessionID, req.getScheme()); + getIdentityLinkForm = AuthenticationServer.getInstance().startAuthentication(authURL, target, null, oaURL, templateURL, bkuURL, useMandate, sessionID, req.getScheme(), sourceID); } else { // use target from config - getIdentityLinkForm = AuthenticationServer.getInstance().startAuthentication(authURL, targetConfig, targetFriendlyNameConfig, oaURL, templateURL, bkuURL, useMandate, sessionID, req.getScheme()); + getIdentityLinkForm = AuthenticationServer.getInstance().startAuthentication(authURL, targetConfig, targetFriendlyNameConfig, oaURL, templateURL, bkuURL, useMandate, sessionID, req.getScheme(), sourceID); } resp.setContentType("text/html;charset=UTF-8"); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java index f7f9d8fed..17cbe7a3d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java @@ -24,26 +24,40 @@ package at.gv.egovernment.moa.id.auth.servlet; +import iaik.pki.PKIException; +import iaik.x509.X509Certificate; + import java.io.IOException; +import java.security.GeneralSecurityException; import java.util.Map; +import javax.net.ssl.SSLSocketFactory; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.xml.transform.TransformerException; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.lang.StringEscapeUtils; +import org.w3c.dom.Element; +import at.gv.egovernment.moa.id.AuthenticationException; import at.gv.egovernment.moa.id.MOAIDException; import at.gv.egovernment.moa.id.auth.AuthenticationServer; import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.WrongParametersException; import at.gv.egovernment.moa.id.auth.builder.DataURLBuilder; -import at.gv.egovernment.moa.id.auth.builder.InfoboxReadRequestBuilderCertificate; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.util.ParamValidatorUtils; -import at.gv.egovernment.moa.id.util.ServletUtils; +import at.gv.egovernment.moa.id.util.SSLUtils; +import at.gv.egovernment.moa.id.util.client.mis.simple.MISSessionId; +import at.gv.egovernment.moa.id.util.client.mis.simple.MISSimpleClient; +import at.gv.egovernment.moa.id.util.client.mis.simple.MISSimpleClientException; import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.DOMUtils; import at.gv.egovernment.moa.util.URLEncoder; /** @@ -143,27 +157,31 @@ public class VerifyAuthenticationBlockServlet extends AuthServlet { String samlArtifactBase64 = AuthenticationServer.getInstance().verifyAuthenticationBlock(sessionID, createXMLSignatureResponse); + if (samlArtifactBase64 == null) { //mandate Mode + + callMISService(session, req, resp); - Logger.debug("Send InfoboxReadRequest to BKU to get signer certificate."); + //Logger.debug("Send InfoboxReadRequest to BKU to get signer certificate."); - String infoboxReadRequest = new InfoboxReadRequestBuilderCertificate().build(true); + //String infoboxReadRequest = new InfoboxReadRequestBuilderCertificate().build(true); // build dataurl - String dataurl = - new DataURLBuilder().buildDataURL( - session.getAuthURL(), - REQ_VERIFY_CERTIFICATE, - session.getSessionID()); +// String dataurl = +// new DataURLBuilder().buildDataURL( +// session.getAuthURL(), +// REQ_VERIFY_CERTIFICATE, +// session.getSessionID()); //Logger.debug("ContentType set to: application/x-www-form-urlencoded (ServletUtils)"); //ServletUtils.writeCreateXMLSignatureRequestURLEncoded(resp, session, infoboxReadRequest, AuthenticationServer.REQ_PROCESS_VALIDATOR_INPUT, "VerifyIdentityLink", dataurl); - Logger.debug("ContentType set to: text/xml;charset=UTF-8 (ServletUtils)"); - ServletUtils.writeCreateXMLSignatureRequest(resp, session, infoboxReadRequest, AuthenticationServer.REQ_PROCESS_VALIDATOR_INPUT, "VerifyIdentityLink", dataurl); + //Logger.debug("ContentType set to: text/xml;charset=UTF-8 (ServletUtils)"); + //ServletUtils.writeCreateXMLSignatureRequest(resp, session, infoboxReadRequest, AuthenticationServer.REQ_PROCESS_VALIDATOR_INPUT, "VerifyIdentityLink", dataurl); } + if (!samlArtifactBase64.equals("Redirect to Input Processor")) { redirectURL = session.getOAURLRequested(); if (!session.getBusinessService()) { @@ -187,6 +205,78 @@ public class VerifyAuthenticationBlockServlet extends AuthServlet { } } + + /** + * Calls the MIS Service + * @param session + * @throws IOException + */ + private void callMISService(AuthenticationSession session, HttpServletRequest req, HttpServletResponse resp) throws IOException { + + try { + AuthConfigurationProvider authConf= AuthConfigurationProvider.getInstance(); + ConnectionParameter connectionParameters = authConf.getOnlineMandatesConnectionParameter(); + SSLSocketFactory sslFactory = SSLUtils.getSSLSocketFactory(AuthConfigurationProvider.getInstance(), connectionParameters); + + // get identitity link as byte[] + Element elem = session.getIdentityLink().getSamlAssertion(); + String s = DOMUtils.serializeNode(elem); + + System.out.println("IDL: " + s); + + byte[] idl = s.getBytes(); + + // redirect url + // build redirect(to the GetMISSessionIdSerlvet) + String redirectURL = + new DataURLBuilder().buildDataURL( + session.getAuthURL(), + GET_MIS_SESSIONID, + session.getSessionID()); + + String oaURL = session.getOAURLRequested(); + OAAuthParameter oaParam = authConf.getOnlineApplicationParameter(oaURL); + String profiles = oaParam.getMandateProfiles(); + + if (profiles == null) { + Logger.error("No Mandate/Profile for OA configured."); + throw new AuthenticationException("auth.16", new Object[] { GET_MIS_SESSIONID}); + } + + String profilesArray[] = profiles.split(","); + for(int i = 0; i < profilesArray.length; i++) { + profilesArray[i] = profilesArray[i].trim(); + } + + String oaFriendlyName = oaParam.getFriendlyName(); + String mandateReferenceValue = session.getMandateReferenceValue(); + X509Certificate cert = session.getSignerCertificate(); + MISSessionId misSessionID = MISSimpleClient.sendSessionIdRequest(connectionParameters.getUrl(), idl, cert.getEncoded(), oaFriendlyName, redirectURL, mandateReferenceValue, profilesArray, sslFactory); + String redirectMISGUI = misSessionID.getRedirectURL(); + + if (misSessionID == null) { + Logger.error("Fehler bei Anfrage an Vollmachten Service. MIS Session ID ist null."); + throw new MISSimpleClientException("Fehler bei Anfrage an Vollmachten Service."); + } + + session.setMISSessionID(misSessionID.getSessiondId()); + + resp.setStatus(302); + resp.addHeader("Location", redirectMISGUI); + Logger.debug("REDIRECT TO: " + redirectURL); + } + catch (MOAIDException ex) { + handleError(null, ex, req, resp); + } catch (GeneralSecurityException ex) { + handleError(null, ex, req, resp); + } catch (PKIException e) { + handleError(null, e, req, resp); + } catch (MISSimpleClientException e) { + handleError(null, e, req, resp); + } catch (TransformerException e) { + handleError(null, e, req, resp); + } + } /** * Adds a parameter to a URL. * @param url the URL diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java index acf8b0b64..27f956c40 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java @@ -146,56 +146,8 @@ public class VerifyCertificateServlet extends AuthServlet { if (useMandate) { - // Mandate Modus - // make request to MIS - - AuthConfigurationProvider authConf= AuthConfigurationProvider.getInstance(); - ConnectionParameter connectionParameters = authConf.getOnlineMandatesConnectionParameter(); - SSLSocketFactory sslFactory = SSLUtils.getSSLSocketFactory(AuthConfigurationProvider.getInstance(), connectionParameters); - - // get identitity link as byte[] - Element elem = session.getIdentityLink().getSamlAssertion(); - String s = DOMUtils.serializeNode(elem); - byte[] idl = s.getBytes(); - - // redirect url - // build redirect(to the GetMISSessionIdSerlvet) - String redirectURL = - new DataURLBuilder().buildDataURL( - session.getAuthURL(), - GET_MIS_SESSIONID, - session.getSessionID()); - - String oaURL = session.getOAURLRequested(); - OAAuthParameter oaParam = authConf.getOnlineApplicationParameter(oaURL); - String profiles = oaParam.getMandateProfiles(); - - if (profiles == null) { - Logger.error("No Mandate/Profile for OA configured."); - throw new AuthenticationException("auth.16", new Object[] { GET_MIS_SESSIONID}); - } - - String profilesArray[] = profiles.split(","); - for(int i = 0; i < profilesArray.length; i++) { - profilesArray[i] = profilesArray[i].trim(); - } - - String oaFriendlyName = oaParam.getFriendlyName(); - String mandateReferenceValue = session.getMandateReferenceValue(); - MISSessionId misSessionID = MISSimpleClient.sendSessionIdRequest(connectionParameters.getUrl(), idl, cert.getEncoded(), oaFriendlyName, redirectURL, mandateReferenceValue, profilesArray, sslFactory); - String redirectMISGUI = misSessionID.getRedirectURL(); - - if (misSessionID == null) { - Logger.error("Fehler bei Anfrage an Vollmachten Service. MIS Session ID ist null."); - throw new MISSimpleClientException("Fehler bei Anfrage an Vollmachten Service."); - } - - session.setMISSessionID(misSessionID.getSessiondId()); - - resp.setStatus(302); - resp.addHeader("Location", redirectMISGUI); - Logger.debug("REDIRECT TO: " + redirectURL); - + Logger.error("Online-Mandate Mode for foreign citizencs not supported."); + throw new AuthenticationException("auth.13", null); } else { // Foreign Identities Modus @@ -218,15 +170,7 @@ public class VerifyCertificateServlet extends AuthServlet { } catch (MOAIDException ex) { handleError(null, ex, req, resp); - } catch (GeneralSecurityException ex) { - handleError(null, ex, req, resp); - } catch (PKIException e) { - handleError(null, e, req, resp); - } catch (MISSimpleClientException e) { - handleError(null, e, req, resp); - } catch (TransformerException e) { - handleError(null, e, req, resp); - } + } } /** diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java index 6d4a21674..fc5d82936 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java @@ -150,7 +150,7 @@ public class VerifyIdentityLinkServlet extends AuthServlet { // create the InfoboxReadRequest to get the certificate String infoboxReadRequest = new InfoboxReadRequestBuilderCertificate().build(true); - // build dataurl (to the GetForeignIDSerlvet) + // build dataurl (to the VerifyCertificateSerlvet) String dataurl = new DataURLBuilder().buildDataURL( session.getAuthURL(), diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java index 7fe85cfae..8cc51bf93 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationBuilder.java @@ -579,6 +579,7 @@ public class ConfigurationBuilder { oap.setProvideIdentityLink(BoolUtils.valueOf(authComponent.getAttribute("provideIdentityLink"))); oap.setProvideCertificate(BoolUtils.valueOf(authComponent.getAttribute("provideCertificate"))); oap.setProvideFullMandatorData(BoolUtils.valueOf(authComponent.getAttribute("provideFullMandatorData"))); + oap.setUseUTC(BoolUtils.valueOf(authComponent.getAttribute("useUTC"))); oap.setBkuSelectionTemplateURL(buildTemplateURL(authComponent, OA_AUTH_COMPONENT_BKUSELECT_TEMPLATE_XPATH, bkuSelectionTemplateURL)); oap.setTemplateURL(buildTemplateURL(authComponent, OA_AUTH_COMPONENT_TEMPLATE_XPATH, templateURL)); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java index f85666acf..65e21cbce 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java @@ -84,6 +84,9 @@ public class OAAuthParameter extends OAParameter { * determines whether the full mandator data (i.e. the mandate) is to be included in the authentication data */ private boolean provideFullMandatorData; + + /** determines wheter the IssueInstant of the SAML assertion is in UTC or not*/ + private boolean useUTC; /** * url to a template for web page "Auswahl der Bürgerkartenumgebung" */ @@ -191,6 +194,14 @@ public class OAAuthParameter extends OAParameter { return provideFullMandatorData; } + /** + * Returns true if the IssueInstant should be given in UTC, otherwise false. + * @return true if the IssueInstant should be given in UTC, otherwise false. + */ + public boolean getUseUTC() { + return useUTC; + } + /** * Returns the key box identifier. @@ -305,6 +316,16 @@ public class OAAuthParameter extends OAParameter { public void setProvideFullMandatorData(boolean provideFullMandatorData) { this.provideFullMandatorData = provideFullMandatorData; } + + /** + * Sets the useUTC variable. + * @param useUTC The useUTC value to set + */ + public void setUseUTC(boolean useUTC) { + this.useUTC = useUTC; + } + + /** * Sets the key box identifier. diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/AuthenticationData.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/AuthenticationData.java index 44eb98dad..79f3b4e30 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/AuthenticationData.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/data/AuthenticationData.java @@ -107,6 +107,9 @@ public class AuthenticationData { * the corresponding lt;saml:Assertion> */ private String samlAssertion; + + /** useUTC */ + private boolean useUTC; /** * creation timestamp */ @@ -166,6 +169,14 @@ public class AuthenticationData { public String getWBPK() { return wbPK; } + + /** + * Returns useUTC + * @return useUTC + */ + public boolean getUseUTC() { + return useUTC; + } /** * Sets the minorVersion. @@ -215,6 +226,10 @@ public class AuthenticationData { this.wbPK = wbPK; } + public void setUseUTC(boolean useUTC) { + this.useUTC = useUTC; + } + /** * Returns the assertionID. * @return String diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java index 5ce952662..2493f42b8 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java @@ -63,7 +63,7 @@ public class SAMLRequestBuilder implements Constants { */ public Element build(String requestID, String samlArtifactBase64) throws BuildException { try { - String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance()); + String issueInstant = DateTimeUtils.buildDateTime(Calendar.getInstance(), true); String request = MessageFormat.format(REQUEST, new Object[] {requestID, issueInstant, samlArtifactBase64}); Element requestElem = DOMUtils.parseDocument(request, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); return requestElem; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java index 8c3bccab3..fa220d13d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java @@ -75,6 +75,36 @@ public class ParamValidatorUtils { return false; } + } + + /** + * Checks if the given target is valid + * @param sourceID HTTP parameter from request + * @return + */ + public static boolean isValidSourceID(String sourceID) { + + Logger.debug("Überprüfe Parameter sourceID"); + + // if non parameter is given return true + if (sourceID == null) { + Logger.debug("Parameter Target ist null"); + return true; + } + + + Pattern pattern = Pattern.compile("[\\w-_]{1,50}"); + Matcher matcher = pattern.matcher(sourceID); + boolean b = matcher.matches(); + if (b) { + Logger.debug("Parameter sourceID erfolgreich überprüft"); + return true; + } + else { + Logger.error("Fehler Überprüfung Parameter sourceID. SourceID entspricht nicht den Kriterien (nur Zeichen a-z, A-Z, - und _, sowie 1-50 Zeichen lang)"); + return false; + } + } /** diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/client/mis/simple/MISSimpleClient.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/client/mis/simple/MISSimpleClient.java index 1181253f1..620919c61 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/client/mis/simple/MISSimpleClient.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/client/mis/simple/MISSimpleClient.java @@ -149,7 +149,8 @@ public class MISSimpleClient { Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); Element mirElement = doc.createElementNS(MIS_NS, "MandateIssueRequest"); Element idlElement = doc.createElementNS(MIS_NS, "IdentityLink"); - + + idlElement.appendChild(doc.createTextNode(new String(Base64.encodeBase64(idl)))); mirElement.appendChild(idlElement); @@ -237,7 +238,18 @@ public class MISSimpleClient { } } - private static Element sendSOAPRequest(String webServiceURL, Element request) throws MISSimpleClientException { + private static Element sendSOAPRequest(String webServiceURL, Element request) throws MISSimpleClientException { + +// try { +// System.out.println("REQUEST-MIS: \n" + DOMUtils.serializeNode(request)); +// } catch (TransformerException e1) { +// // TODO Auto-generated catch block +// e1.printStackTrace(); +// } catch (IOException e1) { +// // TODO Auto-generated catch block +// e1.printStackTrace(); +// } + if (webServiceURL == null) { throw new NullPointerException("Argument webServiceURL must not be null."); } @@ -249,7 +261,8 @@ public class MISSimpleClient { PostMethod post = new PostMethod(webServiceURL); StringRequestEntity re = new StringRequestEntity(DOMUtils.serializeNode(packIntoSOAP(request)),"text/xml", "UTF-8"); post.setRequestEntity(re); - int responseCode = httpclient.executeMethod(post); + int responseCode = httpclient.executeMethod(post); + if (responseCode != 200) { throw new MISSimpleClientException("Invalid HTTP response code " + responseCode); } diff --git a/id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java b/id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java index fcf7477c5..818773794 100644 --- a/id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java +++ b/id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java @@ -47,7 +47,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase { "http://localhost:9080/", //oaURL "file:" + findXmldata("AuthTemplate.html"), "http://localhost:3495/http-security-layer-request", - null, null, null); + null, null, null, null); htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED"); //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8")); assertEquals(readXmldata("htmlForm.html"),htmlForm); @@ -66,7 +66,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase { null, "http://localhost:9080/", //oaURL null, - "http://localhost:3495/http-security-layer-request", null, null, null); + "http://localhost:3495/http-security-layer-request", null, null, null, null); htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED"); //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8")); assertEquals(readXmldata("htmlForm.html"),htmlForm); @@ -87,7 +87,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase { "file:" + findXmldata("AuthTemplate.html"), null, null, - null, null); + null, null, null); htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED"); //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8")); assertEquals(readXmldata("htmlForm.html"),htmlForm); @@ -106,7 +106,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase { "gb", //target null, "http://localhost:9080/", //oaURL - null, null, null, null, null); + null, null, null, null, null, null); //assertEquals("",htmlForm); System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); fail(this.getName() + " hat KEINE FEHLER geworfen"); @@ -126,7 +126,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase { try { server.startAuthentication("http://localhost:8080/auth", //authURL "gb", null, "http://localhost:9080/", //oaURL - null, null, null, null, null); + null, null, null, null, null, null); System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); fail(this.getName() + " hat KEINE FEHLER geworfen"); } @@ -144,7 +144,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase { try { server.startAuthentication("https://localhost:8443/auth", //authURL "gb", null, "http://host_not_in_config/", //oaURL - null, null, null, null, null); + null, null, null, null, null, null); System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); fail(this.getName() + " hat KEINE FEHLER geworfen"); } @@ -163,7 +163,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase { try { server.startAuthentication("https://localhost:8443/auth", //authURL "gb", null, null, //oaURL - null, null, null, null, null); + null, null, null, null, null, null); System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); fail(this.getName() + " hat KEINE FEHLER geworfen"); } @@ -182,7 +182,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase { try { server.startAuthentication("https://localhost:8443/auth", //authURL null, null, "http://localhost:9080/", //oaURL - null, null, null, null, null); + null, null, null, null, null, null); System.err.println(this.getName() + " hat KEINE FEHLER geworfen"); fail(this.getName() + " hat KEINE FEHLER geworfen"); } diff --git a/id/server/idserverlib/src/test/java/test/abnahme/A/Test300VerifyAuthBlock.java b/id/server/idserverlib/src/test/java/test/abnahme/A/Test300VerifyAuthBlock.java index 6ebb3cf3e..d9cd13259 100644 --- a/id/server/idserverlib/src/test/java/test/abnahme/A/Test300VerifyAuthBlock.java +++ b/id/server/idserverlib/src/test/java/test/abnahme/A/Test300VerifyAuthBlock.java @@ -598,7 +598,7 @@ public class Test300VerifyAuthBlock extends AbnahmeTestCase { authData.setMinorVersion(0); authData.setAssertionID(Random.nextRandom()); authData.setIssuer(session.getAuthURL()); - authData.setIssueInstant(DateTimeUtils.buildDateTime(Calendar.getInstance())); + authData.setIssueInstant(DateTimeUtils.buildDateTime(Calendar.getInstance(), false)); String vpkBase64 = new BPKBuilder().buildBPK( identityLink.getIdentificationValue(), session.getTarget()); authData.setBPK(vpkBase64); @@ -619,7 +619,7 @@ public class Test300VerifyAuthBlock extends AbnahmeTestCase { oaParam.getProvideIdentityLink() ? DOMUtils.serializeNode(identityLink.getSamlAssertion()) : ""; String authBlock = oaParam.getProvideAuthBlock() ? session.getAuthBlock() : ""; String samlAssertion = new AuthenticationDataAssertionBuilder().build( - authData, prPerson, authBlock, ilAssertion, session.getBkuURL(), "", false, null); + authData, prPerson, authBlock, ilAssertion, session.getBkuURL(), "", false, null, null); authData.setSamlAssertion(samlAssertion); return authData; } diff --git a/id/server/idserverlib/src/test/java/test/abnahme/A/Test600GetAuthenticationDataService.java b/id/server/idserverlib/src/test/java/test/abnahme/A/Test600GetAuthenticationDataService.java index a66e6072c..fab258e09 100644 --- a/id/server/idserverlib/src/test/java/test/abnahme/A/Test600GetAuthenticationDataService.java +++ b/id/server/idserverlib/src/test/java/test/abnahme/A/Test600GetAuthenticationDataService.java @@ -228,7 +228,7 @@ public class Test600GetAuthenticationDataService extends AbnahmeTestCase { String request = "" + + DateTimeUtils.buildDateTime(Calendar.getInstance(), false)+"\">" + ""; Element samlPRequest = DOMUtils.parseDocument(request, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); diff --git a/id/server/idserverlib/src/test/java/test/abnahme/AbnahmeTestCase.java b/id/server/idserverlib/src/test/java/test/abnahme/AbnahmeTestCase.java index 69f33f82c..8e38c7673 100644 --- a/id/server/idserverlib/src/test/java/test/abnahme/AbnahmeTestCase.java +++ b/id/server/idserverlib/src/test/java/test/abnahme/AbnahmeTestCase.java @@ -142,7 +142,7 @@ public class AbnahmeTestCase extends MOAIDTestCase { null, null, null, - null); + null, null); String sessionID = parseSessionIDFromForm(htmlForm); return sessionID; } diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java index 052c1fed4..187f577a3 100644 --- a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/AuthenticationServerTest.java @@ -54,7 +54,7 @@ public class AuthenticationServerTest extends UnitTestCase { public void doTest(String testdataDirectory, String authURL, String target, String oaURL, String bkuURL, String templateURL) throws Exception { String testdataRoot = TESTDATA_ROOT + "xmldata/" + testdataDirectory + "/"; AuthenticationServer server = AuthenticationServer.getInstance(); - String htmlForm = server.startAuthentication(authURL, target, null, oaURL, templateURL, bkuURL, null, null, null); + String htmlForm = server.startAuthentication(authURL, target, null, oaURL, templateURL, bkuURL, null, null, null, null); String sessionID = parseSessionIDFromForm(htmlForm); String infoboxReadResponse = readFile(TESTDATA_ROOT + "xmldata/testperson1/" + "InfoboxReadResponse.xml"); HashMap parameters = new HashMap(1); -- cgit v1.2.3