aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-03-06 08:52:17 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-03-06 08:58:30 +0100
commit96dee381a4dd221a6f7dc9a63c9dda72e7cbbb04 (patch)
tree4ae7d012dea2c39eec4ac9855ee27d9e6844f6cf /id/server/idserverlib
parent2aa46e49f1566ed6582fa40e0fdffb4ec9b790b4 (diff)
downloadmoa-id-spss-96dee381a4dd221a6f7dc9a63c9dda72e7cbbb04.tar.gz
moa-id-spss-96dee381a4dd221a6f7dc9a63c9dda72e7cbbb04.tar.bz2
moa-id-spss-96dee381a4dd221a6f7dc9a63c9dda72e7cbbb04.zip
cleanup SignedDoc AP Plugin
Diffstat (limited to 'id/server/idserverlib')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java19
2 files changed, 8 insertions, 13 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java
index cbe7e5f3c..c998b5f69 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java
@@ -37,7 +37,7 @@ public class AttributeProviderFactory {
} else if (shortname.equals("EHvdAttributeProvider")) {
return new EHvdAttributeProviderPlugin(url, attributes);
} else if (shortname.equals("SignedDocAttributeRequestProvider")) {
- return new SignedDocAttributeRequestProvider(url);
+ return new SignedDocAttributeRequestProvider(url, attributes);
} else {
return null;
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java
index 59b4f386f..3993ee92f 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/SignedDocAttributeRequestProvider.java
@@ -17,18 +17,10 @@ import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
import at.gv.egovernment.moa.id.auth.stork.VelocityProvider;
import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
-import at.gv.egovernment.moa.id.util.HTTPUtils;
import at.gv.egovernment.moa.logging.Logger;
-import at.gv.egovernment.moa.util.StringUtils;
-
import eu.stork.peps.auth.commons.IPersonalAttributeList;
-import eu.stork.peps.auth.commons.PEPSUtil;
import eu.stork.peps.auth.commons.PersonalAttribute;
import eu.stork.peps.auth.commons.PersonalAttributeList;
-import eu.stork.peps.auth.commons.STORKAttrQueryRequest;
-import eu.stork.peps.auth.commons.STORKAttrQueryResponse;
-import eu.stork.peps.auth.engine.STORKSAMLEngine;
-import eu.stork.peps.exceptions.STORKSAMLEngineException;
/**
* Forwards a signedDoc attribute request to the oasis-dss service instance
@@ -42,14 +34,19 @@ public class SignedDocAttributeRequestProvider implements AttributeProvider {
*/
private String oasisDssWebFormURL;
+ /** The attributes. */
+ private String attributes;
+
/**
* Instantiates a new signed doc attribute request provider.
*
* @param oasisDssWebFormURL
* the AP location
+ * @param attributes
*/
- public SignedDocAttributeRequestProvider(String oasisDssWebFormURL) {
+ public SignedDocAttributeRequestProvider(String oasisDssWebFormURL, String attributes) {
this.oasisDssWebFormURL = oasisDssWebFormURL;
+ this.attributes = attributes;
}
/*
@@ -61,7 +58,7 @@ public class SignedDocAttributeRequestProvider implements AttributeProvider {
*/
public IPersonalAttributeList acquire(PersonalAttribute attribute, String spCountyCode, AuthenticationSession moasession) throws UnsupportedAttributeException,
ExternalAttributeRequestRequiredException {
- if(!attribute.getName().equals("signedDoc")){
+ if(!attributes.contains(attribute.getName())) {
throw new UnsupportedAttributeException();
}
@@ -80,8 +77,6 @@ public class SignedDocAttributeRequestProvider implements AttributeProvider {
public IPersonalAttributeList parse(HttpServletRequest httpReq) throws MOAIDException, UnsupportedAttributeException {
Logger.debug("Beginning to extract OASIS-DSS response out of HTTP Request");
-
- STORKSAMLEngine engine = STORKSAMLEngine.getInstance("VIDP");
try {
String signResponse = new String(Base64.decodeBase64(httpReq.getParameter("signresponse")), "UTF8");
List<String> values = new ArrayList<String>();