aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/moa-id-module-elga_mandate_service
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-03-24 10:43:55 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-03-24 10:43:55 +0100
commit859d7b200e1efa6caa1c72e32f22e61660b1b2ef (patch)
treecd43cac1a47d782e5bd0f32691cd95eddd51d793 /id/server/modules/moa-id-module-elga_mandate_service
parent2360a1be1c26b360af0ef66e0c2d0b126b26719b (diff)
downloadmoa-id-spss-859d7b200e1efa6caa1c72e32f22e61660b1b2ef.tar.gz
moa-id-spss-859d7b200e1efa6caa1c72e32f22e61660b1b2ef.tar.bz2
moa-id-spss-859d7b200e1efa6caa1c72e32f22e61660b1b2ef.zip
update ELGA Mandate-Service client modul
Diffstat (limited to 'id/server/modules/moa-id-module-elga_mandate_service')
-rw-r--r--id/server/modules/moa-id-module-elga_mandate_service/src/main/java/at/gv/egovernment/moa/id/auth/modules/elgamandates/config/ELGAMandatesRequestBuilderConfiguration.java19
-rw-r--r--id/server/modules/moa-id-module-elga_mandate_service/src/main/java/at/gv/egovernment/moa/id/auth/modules/elgamandates/tasks/ReceiveElgaMandateResponseTask.java4
2 files changed, 11 insertions, 12 deletions
diff --git a/id/server/modules/moa-id-module-elga_mandate_service/src/main/java/at/gv/egovernment/moa/id/auth/modules/elgamandates/config/ELGAMandatesRequestBuilderConfiguration.java b/id/server/modules/moa-id-module-elga_mandate_service/src/main/java/at/gv/egovernment/moa/id/auth/modules/elgamandates/config/ELGAMandatesRequestBuilderConfiguration.java
index 60025075f..b67d263fc 100644
--- a/id/server/modules/moa-id-module-elga_mandate_service/src/main/java/at/gv/egovernment/moa/id/auth/modules/elgamandates/config/ELGAMandatesRequestBuilderConfiguration.java
+++ b/id/server/modules/moa-id-module-elga_mandate_service/src/main/java/at/gv/egovernment/moa/id/auth/modules/elgamandates/config/ELGAMandatesRequestBuilderConfiguration.java
@@ -252,8 +252,9 @@ public class ELGAMandatesRequestBuilderConfiguration implements IPVPAuthnRequest
*/
public void setSubjectConformationDate(String givenName, String familyName, String dateOfBirth) {
try {
- SubjectConfirmationData subjectConformDate = SAML2Utils.createSAMLObject(SubjectConfirmationData.class);
-
+ Logger.trace("Build 'SubjectConfirmationData' for ELGA Mandate-Service request ...");
+ //build empty 'SubjectConfirmationData' element
+ SubjectConfirmationData subjectConformDate = SAML2Utils.createSAMLObject(SubjectConfirmationData.class);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder builder = dbf.newDocumentBuilder();
@@ -263,7 +264,7 @@ public class ELGAMandatesRequestBuilderConfiguration implements IPVPAuthnRequest
.getMarshaller(subjectConformDate);
out.marshall(subjectConformDate, doc);
- //build root element
+ //build root element for personal information
Element rootDom = doc.createElementNS(
ELGAMandatesAuthConstants.SUBJECTCONFORMATIONDATE_ELEMENT_NAMESPACE_URI,
ELGAMandatesAuthConstants.SUBJECTCONFORMATIONDATE_ELEMENT_ROOT);
@@ -274,24 +275,20 @@ public class ELGAMandatesRequestBuilderConfiguration implements IPVPAuthnRequest
//build personal information
Element familyNameDom = doc.createElement(ELGAMandatesAuthConstants.SUBJECTCONFORMATIONDATE_ELEMENT_FAMILYNAME);
- //familyNameDom.setPrefix(ELGAMandatesAuthConstants.SUBJECTCONFORMATIONDATE_ELEMENT_NAMESPACE);
- familyNameDom.setTextContent(familyName);
-
Element givenNameDom = doc.createElement(ELGAMandatesAuthConstants.SUBJECTCONFORMATIONDATE_ELEMENT_GIVENNAME);
- //givenNameDom.setPrefix(ELGAMandatesAuthConstants.SUBJECTCONFORMATIONDATE_ELEMENT_NAMESPACE);
- givenNameDom.setTextContent(givenName);
-
Element dateOfBirthDom = doc.createElement(ELGAMandatesAuthConstants.SUBJECTCONFORMATIONDATE_ELEMENT_DATEOFBIRTH);
- //dateOfBirthDom.setPrefix(ELGAMandatesAuthConstants.SUBJECTCONFORMATIONDATE_ELEMENT_NAMESPACE);
+ familyNameDom.setTextContent(familyName);
+ givenNameDom.setTextContent(givenName);
dateOfBirthDom.setTextContent(dateOfBirth);
- //add information to root element
+ //add personal information to 'SubjectConfirmationData' element
doc.getFirstChild().appendChild(rootDom);
rootDom.appendChild(givenNameDom);
rootDom.appendChild(familyNameDom);
rootDom.appendChild(dateOfBirthDom);
this.subjectConformationDate = doc.getDocumentElement();
+ Logger.trace("'SubjectConfirmationData' for ELGA Mandate-Service is complete");
} catch (ParserConfigurationException | MarshallingException e) {
Logger.error("Can not generate 'SubjectConformationDate' for "
diff --git a/id/server/modules/moa-id-module-elga_mandate_service/src/main/java/at/gv/egovernment/moa/id/auth/modules/elgamandates/tasks/ReceiveElgaMandateResponseTask.java b/id/server/modules/moa-id-module-elga_mandate_service/src/main/java/at/gv/egovernment/moa/id/auth/modules/elgamandates/tasks/ReceiveElgaMandateResponseTask.java
index 8960041f5..5604b7640 100644
--- a/id/server/modules/moa-id-module-elga_mandate_service/src/main/java/at/gv/egovernment/moa/id/auth/modules/elgamandates/tasks/ReceiveElgaMandateResponseTask.java
+++ b/id/server/modules/moa-id-module-elga_mandate_service/src/main/java/at/gv/egovernment/moa/id/auth/modules/elgamandates/tasks/ReceiveElgaMandateResponseTask.java
@@ -150,6 +150,7 @@ public class ReceiveElgaMandateResponseTask extends AbstractAuthServletTask {
defaultTaskInitialization(request, executionContext);
//validate receive mandate reference-value
+ //TODO: update if ReferenceValue Discussion is finished
String responseRefValue = extractor.getSingleAttributeValue(PVPConstants.MANDATE_REFERENCE_VALUE_NAME);
if (!moasession.getMandateReferenceValue().equals(responseRefValue)) {
Logger.warn("PVP Response from ELGA mandate-service contains a not valid MandateReferenceValue.");
@@ -172,7 +173,8 @@ public class ReceiveElgaMandateResponseTask extends AbstractAuthServletTask {
authenticatedSessionStorage.storeSession(moasession);
//write revisions log entry
- revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.AUTHPROCESS_ELGA_MANDATE_RECEIVED);
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.AUTHPROCESS_ELGA_MANDATE_RECEIVED,
+ extractor.getSingleAttributeValue(PVPConstants.MANDATE_REFERENCE_VALUE_NAME));
//write mandate info's to revisions log
revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.PERSONAL_INFORMATION_MANDATE_TYPE,