aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at/gv
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-30 13:14:34 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-31 17:16:10 +0100
commit3e512ed4c85444fcbd3d364ffa48aa3291813b73 (patch)
treebc4f3acc26dcc0614724d759474334e0e66ba522 /id/server/idserverlib/src/main/java/at/gv
parent85a983b556baaaa45ea79a4da232a1a72d323708 (diff)
downloadmoa-id-spss-3e512ed4c85444fcbd3d364ffa48aa3291813b73.tar.gz
moa-id-spss-3e512ed4c85444fcbd3d364ffa48aa3291813b73.tar.bz2
moa-id-spss-3e512ed4c85444fcbd3d364ffa48aa3291813b73.zip
supply organization details on representative case
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java36
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java16
2 files changed, 41 insertions, 11 deletions
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 204e7f724..d77119f4a 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
@@ -1699,7 +1699,7 @@ public class AuthenticationServer implements MOAIDAuthConstants {
* @throws SZRGWClientException
*/
- public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String citizenSignature, String represented, String representative, String mandateContent) throws SZRGWClientException {
+ public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String citizenSignature, String represented, String representative, String mandateContent, String organizationAddress, String organizationType) throws SZRGWClientException {
SZRGWClient client = null;
@@ -1712,20 +1712,19 @@ public class AuthenticationServer implements MOAIDAuthConstants {
CreateIdentityLinkRequest request = new CreateIdentityLinkRequest();
request.setSignature(citizenSignature.getBytes());
-
+
PEPSData data = new PEPSData();
data.setDateOfBirth(PEPSDateOfBirth);
data.setFamilyname(PEPSFamilyname);
data.setFirstname(PEPSFirstname);
data.setIdentifier(PEPSIdentifier);
-// TODO add mandate data
-// data.setRepresentative(representative);
-// data.setRepresented(represented);
-// data.setMandateContent(mandateContent);
+ data.setRepresentative(representative);
+ data.setRepresented(represented);
+ data.setMandateContent(mandateContent);
- if(null != PEPSIdentifier)
- request.setPEPSData(data);
+ data.setLegalPersonCanonicalRegisteredAddress(organizationAddress);
+ data.setLegalPersonTranslatableType(organizationType);
// TODO add MIS data
// request.setMIS(value)
@@ -1812,6 +1811,27 @@ public class AuthenticationServer implements MOAIDAuthConstants {
public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature) throws SZRGWClientException {
return getIdentityLink(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, signature, null, null, null);
}
+
+ /**
+ * SZR-GW Client interface.
+ *
+ * @param eIdentifier the e identifier
+ * @param givenName the given name
+ * @param lastName the last name
+ * @param dateOfBirth the date of birth
+ * @param citizenSignature the citizen signature
+ * @param representative the representative
+ * @param represented the represented
+ * @param mandate the mandate
+ * @return the identity link
+ * @throws SZRGWClientException the sZRGW client exception
+ */
+ public CreateIdentityLinkResponse getIdentityLink(String eIdentifier,
+ String givenName, String lastName, String dateOfBirth,
+ String citizenSignature, String representative, String represented,
+ String mandate) throws SZRGWClientException {
+ return getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate, null, null);
+ }
/**
* Starts a MOA-ID authentication process using STORK
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java
index 664d0cf57..e81adfb52 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java
@@ -345,10 +345,20 @@ public class STORKResponseProcessor {
String representative = getAttributeValue("representative", attributeList);
String represented = getAttributeValue("represented", attributeList);
String mandate = getAttributeValue("mandateContent", attributeList);
+
+ // we definitely know we have a representation case here
+ // lets try if the represented is an organization
+ try {
+ String organizationAddress = getAttributeValue("canonicalRegisteredAddress", attributeList);
+ String organizationType = getAttributeValue("translateableType", attributeList);
+
+ // if we got here, we have a natural person representing a legal person
+ response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate, organizationAddress, organizationType);
+ } catch(STORKException e1) {
- // if we get here we have a representation case
- response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate);
-
+ // if we get here we have natural persons representing each other
+ response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate);
+ }
} catch(STORKException e) {
// we do not have a representation case
response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature);