diff options
Diffstat (limited to 'id/server/idserverlib/src')
13 files changed, 70 insertions, 30 deletions
| diff --git a/id/server/idserverlib/src/main/java/META-INF/MANIFEST.MF b/id/server/idserverlib/src/main/java/META-INF/MANIFEST.MF deleted file mode 100644 index 5e9495128..000000000 --- a/id/server/idserverlib/src/main/java/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0
 -Class-Path: 
 -
 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 bac66eeab..caeff905b 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 @@ -265,7 +265,8 @@ public class AuthenticationServer implements MOAIDAuthConstants {     * @param oaURL online application URL requested     * @param bkuURL URL of the "Bürgerkartenumgebung" to be used;      *                may be <code>null</code>; in this case, the default location will be used -   * @param templateURL URL providing an HTML template for the HTML form generated  +   * @param templateURL URL providing an HTML template for the HTML form generated +   * @param scheme determines the protocol used      * @return HTML form     * @throws AuthenticationException     * @see GetIdentityLinkFormBuilder @@ -277,7 +278,8 @@ public class AuthenticationServer implements MOAIDAuthConstants {      String oaURL,      String templateURL,      String bkuURL, -    String sessionID) +    String sessionID, +    String scheme)      throws WrongParametersException, AuthenticationException, ConfigurationException, BuildException {      if (isEmpty(sessionID)) { @@ -322,7 +324,11 @@ public class AuthenticationServer implements MOAIDAuthConstants {      }      // BKU URL has not been set yet, even if session already exists      if (bkuURL == null) { -      bkuURL = DEFAULT_BKU; +      if (scheme!=null && scheme.equalsIgnoreCase("https")) { +        bkuURL = DEFAULT_BKU_HTTPS; +      } else { +        bkuURL = DEFAULT_BKU; +      }      }      session.setBkuURL(bkuURL);      session.setDomainIdentifier(oaParam.getIdentityLinkDomainIdentifier()); @@ -602,6 +608,10 @@ public class AuthenticationServer implements MOAIDAuthConstants {                }                // check for party representation in mandates infobox                if (Constants.INFOBOXIDENTIFIER_MANDATES.equalsIgnoreCase(identifier) && !((infoboxTokenList == null || infoboxTokenList.size() == 0))){ +                //We need app specific parameters +                if (null==verifyInfoboxParameter.getApplicationSpecificParams()) { +                  throw new ValidateException("validator.66", new Object[] {friendlyName}); +                }                  session.setMandateCompatibilityMode(ParepConfiguration.isMandateCompatibilityMode(verifyInfoboxParameter.getApplicationSpecificParams()));                  Element mandate = ParepValidator.extractPrimaryToken(infoboxTokenList);                  //ParepUtils.serializeElement(mandate, System.out); 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 4f9235949..72f29ed40 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 @@ -23,6 +23,8 @@ public interface MOAIDAuthConstants {    public static final String PARAM_INPUT_PROCESSOR_SIGN_TEMPLATE = "InputProcessorSignTemplate";    /** default BKU URL */    public static final String DEFAULT_BKU = "http://localhost:3495/http-security-layer-request"; +  /** default BKU URL for https connections*/ +  public static final String DEFAULT_BKU_HTTPS = "https://127.0.0.1:3496/https-security-layer-request";    /** servlet parameter "returnURI" */    public static final String PARAM_RETURN = "returnURI";    /** servlet parameter "Template" */ diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java index 0d0595b69..9a6c4801f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/GetIdentityLinkFormBuilder.java @@ -95,7 +95,6 @@ public class GetIdentityLinkFormBuilder extends Builder {    throws BuildException     {          	String htmlForm = htmlTemplate == null ? DEFAULT_HTML_TEMPLATE : htmlTemplate; -//    String bku = bkuURL == null ? DEFAULT_BKU : bkuURL;      htmlForm = replaceTag(htmlForm, BKU_TAG, bkuURL, true, ALL);      htmlForm = replaceTag(htmlForm, XMLREQUEST_TAG, encodeParameter(xmlRequest), true, ALL);      htmlForm = replaceTag(htmlForm, DATAURL_TAG, dataURL, true, ALL); 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 9f0cf6606..912b20a0f 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 @@ -57,7 +57,7 @@ public class StartAuthenticationServlet extends AuthServlet {      resp.addHeader(HEADER_CACHE_CONTROL,HEADER_VALUE_CACHE_CONTROL_IE);  		try {  			String getIdentityLinkForm = -				AuthenticationServer.getInstance().startAuthentication(authURL, target, oaURL, templateURL, bkuURL, sessionID); +				AuthenticationServer.getInstance().startAuthentication(authURL, target, oaURL, templateURL, bkuURL, sessionID, req.getScheme());  			resp.setContentType("text/html;charset=UTF-8");  			PrintWriter out = new PrintWriter(resp.getOutputStream());  			out.print(getIdentityLinkForm); 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 27955602f..d4398102c 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 @@ -821,6 +821,8 @@ public class ConfigurationBuilder {              verifyInfoboxParameter.setSchemaLocations(schemaLocations);                        } else if (paramName.equals("ApplicationSpecificParameters")) {              verifyInfoboxParameter.setApplicationSpecificParams(paramElem); +          } else if (paramName.equals("ParepSpecificParameters")) { +            verifyInfoboxParameter.appendParepSpecificParams(paramElem);            }          }                  // use default values for those parameters not yet set by local configuration diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java index fbd42f975..b64303ce5 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/VerifyInfoboxParameter.java @@ -6,9 +6,13 @@ import java.util.List;  import javax.xml.transform.TransformerException; +import org.apache.xpath.XPathAPI;  import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList;  import at.gv.egovernment.moa.id.auth.data.Schema; +import at.gv.egovernment.moa.util.Constants;  import at.gv.egovernment.moa.util.DOMUtils;  import at.gv.egovernment.moa.util.StringUtils; @@ -122,6 +126,29 @@ public class VerifyInfoboxParameter {    }    /** +   * Appends special application specific parameters for party representation. +   *  +   * @param applicationSpecificParams The application specific parameters for party representation to set. +   */ +  public void appendParepSpecificParams(Element applicationSpecificParams) { +    try { +      if (applicationSpecificParams_==null) { +        applicationSpecificParams_ = applicationSpecificParams.getOwnerDocument().createElement("ApplicationSpecificParameters"); +      }  +      Element nameSpaceNode = applicationSpecificParams.getOwnerDocument().createElement("NameSpaceNode"); +      nameSpaceNode.setAttribute("xmlns:" + Constants.MOA_ID_CONFIG_PREFIX, Constants.MOA_ID_CONFIG_NS_URI); +      NodeList nodeList = XPathAPI.selectNodeList(applicationSpecificParams, "*", nameSpaceNode); +      if (null!=nodeList) { +        for (int i=0; i<nodeList.getLength(); i++) { +          applicationSpecificParams_.appendChild((Node) nodeList.item(i)); +        } +      } +    } catch (TransformerException e) { +      //Do nothing +    } +  } +   +  /**     * Returns the friendly name.     *      * @see #friendlyName_ diff --git a/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties b/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties index 8e8f9583b..825434b91 100644 --- a/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties +++ b/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties @@ -163,5 +163,6 @@ validator.62=Fehler in der Übermittlung: keine primäre Vollmacht übergeben.  validator.63=Es ist ein Fehler bei der Formulargenerierung für berufliche Parteienvetretung aufgetreten.
  validator.64=Fehler beim Austausch von Vollmachtsdaten
  validator.65=Es ist ein Fehler bei der Formulargenerierung für berufliche Parteienvetretung aufgetreten - kein Formular zur Anzeige vorhanden.
 +validator.66=Überprüfung der {0}-Infobox fehlgeschlagen: berufliche Parteienvetretung ist nicht konfiguriert.
  ssl.01=Validierung des SSL-Server-Endzertifikates hat fehlgeschlagen
 diff --git a/id/server/idserverlib/src/main/resources/resources/templates/ParepMinTemplate.html b/id/server/idserverlib/src/main/resources/resources/templates/ParepMinTemplate.html index 61e5adcaa..0ce83ba12 100644 --- a/id/server/idserverlib/src/main/resources/resources/templates/ParepMinTemplate.html +++ b/id/server/idserverlib/src/main/resources/resources/templates/ParepMinTemplate.html @@ -7,7 +7,7 @@  </head>
  <body>
  Berufsmäßige Parteienvertretung einer natürlichen/juristischen Person
 -<form name="ProcessInputForm" method="post" accept-charset="UTF-8" enctype="application/x-www-form-urlencoded"  action="<BKU>"> 
 +<form name="ProcessInputForm" method="post" accept-charset="UTF-8" enctype="application/x-www-form-urlencoded"  action="<BKU>">
    <table width="80%" border="0">
      <tr/>
      <tr/>
 @@ -42,7 +42,7 @@ Berufsmäßige Parteienvertretung einer natürlichen/juristischen P      </tr>
      <tr>
        <td colspan="3"><br/>
 -          <em>Vetretene Person:</em></td>
 +          <em>Vertretene Person:</em></td>
      </tr>
      <tr>
        <td  colspan="3"><input name="physical_" type="radio" physdisabled="" value="true" physselected="" /> natürliche Person: </td>
 @@ -101,9 +101,9 @@ Berufsmäßige Parteienvertretung einer natürlichen/juristischen P        </td>
        <td></td>
      </tr>
 -    <tr>  
 +    <tr>
  	  <td colspan="3"> </td>
 -    </tr>  
 +    </tr>
      <tr>
        <td  colspan="3"><input name="physical_" type="radio" cbdisabled="" value="false" cbselected=""/ > juristische Person: </td>
      </tr>
 @@ -124,11 +124,11 @@ Berufsmäßige Parteienvertretung einer natürlichen/juristischen P        <td></td>
      </tr>
    </table>
 -  <br/><errortext>  
 -  <p><em>Bitte halten Sie Ihre Bürgerkartenumgebung bereit.</em></p>  <p>   
 +  <br/><errortext>
 +  <p><em>Bitte halten Sie Ihre Bürgerkartenumgebung bereit.</em></p>  <p>
    <input name="XMLRequest" type="hidden" value="<?xml version='1.0' encoding='UTF-8'?><NullOperationRequest xmlns='http://www.buergerkarte.at/namespaces/securitylayer/1.2#'/>"/>
    <input name="DataURL" type="hidden" value="<DataURL>"/>
 -  <input type="submit" name="Submit" value="      Weiter      "/>    
 +  <input type="submit" name="Submit" value="      Weiter      "/>
    <input name="Clear" type="reset" id="Clear" value="Formular zurücksetzen"/></p><br/>
  </form>
  </body>
 diff --git a/id/server/idserverlib/src/main/resources/resources/templates/ParepTemplate.html b/id/server/idserverlib/src/main/resources/resources/templates/ParepTemplate.html index c7b95f598..cd3221b6e 100644 --- a/id/server/idserverlib/src/main/resources/resources/templates/ParepTemplate.html +++ b/id/server/idserverlib/src/main/resources/resources/templates/ParepTemplate.html @@ -42,7 +42,7 @@ Bitte beachten Sie  <h2>Berufsmäßige Parteienvertretung einer natürlichen/juristischen Person
  </h2>
  <div class="boundingbox">
 -<form name="ProcessInputForm" method="post" accept-charset="UTF-8" enctype="application/x-www-form-urlencoded"  action="<BKU>"> 
 +<form name="ProcessInputForm" method="post" accept-charset="UTF-8" enctype="application/x-www-form-urlencoded"  action="<BKU>">
    <table width="80%" border="0">
      <tr/>
      <tr/>
 @@ -77,7 +77,7 @@ Bitte beachten Sie      </tr>
      <tr>
        <td colspan="3"><br/>
 -          <em>Vetretene Person:</em></td>
 +          <em>Vertretene Person:</em></td>
      </tr>
      <tr>
        <td  colspan="3"><input name="physical_" type="radio" physdisabled="" value="true" physselected="" /> natürliche Person: </td>
 @@ -136,9 +136,9 @@ Bitte beachten Sie        </td>
        <td></td>
      </tr>
 -    <tr>  
 +    <tr>
  	  <td colspan="3"> </td>
 -    </tr>  
 +    </tr>
      <tr>
        <td  colspan="3"><input name="physical_" type="radio" cbdisabled="" value="false" cbselected=""/ > juristische Person: </td>
      </tr>
 @@ -159,11 +159,11 @@ Bitte beachten Sie        <td></td>
      </tr>
    </table>
 -  <br/><errortext>  
 -  <p><em>Bitte halten Sie Ihre Bürgerkartenumgebung bereit.</em></p>  <p>   
 +  <br/><errortext>
 +  <p><em>Bitte halten Sie Ihre Bürgerkartenumgebung bereit.</em></p>  <p>
    <input name="XMLRequest" type="hidden" value="<?xml version='1.0' encoding='UTF-8'?><NullOperationRequest xmlns='http://www.buergerkarte.at/namespaces/securitylayer/1.2#'/>"/>
    <input name="DataURL" type="hidden" value="<DataURL>"/>
 -  <input type="submit" name="Submit" value="      Weiter      "/>    
 +  <input type="submit" name="Submit" value="      Weiter      "/>
    <input name="Clear" type="reset" id="Clear" value="Formular zurücksetzen"/></p><br/>
  </form>
  </div>
 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 0d72691aa..66256446e 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 @@ -22,7 +22,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase {          "http://localhost:9080/", //oaURL          "file:" + findXmldata("AuthTemplate.html"),           "http://localhost:3495/http-security-layer-request", -         null); +         null, null);        htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED");        //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8"));        assertEquals(readXmldata("htmlForm.html"),htmlForm); @@ -40,7 +40,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase {          "gb", //target          "http://localhost:9080/", //oaURL          null,  -        "http://localhost:3495/http-security-layer-request", null); +        "http://localhost:3495/http-security-layer-request", null, null);        htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED");        //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8"));        assertEquals(readXmldata("htmlForm.html"),htmlForm); @@ -59,6 +59,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase {          "http://localhost:9080/", //oaURL          "file:" + findXmldata("AuthTemplate.html"),            null, +         null,           null);        htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED");        //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8")); @@ -77,7 +78,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase {          server.startAuthentication(null, //authURL          "gb", //target          "http://localhost:9080/", //oaURL -        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"); @@ -97,7 +98,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase {        try {          server.startAuthentication("http://localhost:8080/auth", //authURL          "gb", "http://localhost:9080/", //oaURL -        null, null, null); +        null, null, null, null);          System.err.println(this.getName() + " hat KEINE FEHLER geworfen");          fail(this.getName() + " hat KEINE FEHLER geworfen");        } @@ -115,7 +116,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase {        try {          server.startAuthentication("https://localhost:8443/auth", //authURL          "gb", "http://host_not_in_config/", //oaURL -        null, null, null); +        null, null, null, null);          System.err.println(this.getName() + " hat KEINE FEHLER geworfen");          fail(this.getName() + " hat KEINE FEHLER geworfen");        } @@ -134,7 +135,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase {        try {          server.startAuthentication("https://localhost:8443/auth", //authURL          "gb", null, //oaURL -        null, null, null); +        null, null, null, null);          System.err.println(this.getName() + " hat KEINE FEHLER geworfen");          fail(this.getName() + " hat KEINE FEHLER geworfen");        } @@ -153,7 +154,7 @@ public class Test100StartAuthentication extends AbnahmeTestCase {        try {          server.startAuthentication("https://localhost:8443/auth", //authURL          null, "http://localhost:9080/", //oaURL -        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/AbnahmeTestCase.java b/id/server/idserverlib/src/test/java/test/abnahme/AbnahmeTestCase.java index e0e6fc183..eaafd9ac8 100644 --- a/id/server/idserverlib/src/test/java/test/abnahme/AbnahmeTestCase.java +++ b/id/server/idserverlib/src/test/java/test/abnahme/AbnahmeTestCase.java @@ -115,6 +115,7 @@ public class AbnahmeTestCase extends MOAIDTestCase {        oaURL,        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 5acb23dc2..dcabd79a4 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 @@ -30,7 +30,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, oaURL, templateURL, bkuURL, null); +  	String htmlForm = server.startAuthentication(authURL, target, oaURL, templateURL, bkuURL, null, null);    	String sessionID = parseSessionIDFromForm(htmlForm);    	String infoboxReadResponse = readFile(TESTDATA_ROOT + "xmldata/testperson1/" + "InfoboxReadResponse.xml");      HashMap parameters = new HashMap(1); | 
