aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-03-04 17:05:01 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-03-04 17:07:35 +0100
commit7ce4c799eb26f65ef8826b74d0fb09a8d1f4949d (patch)
treed15aced78bb198642b7068609d733fa9ef1af780 /id
parent4e5383a60b4cc2db7b51883f2e85aeff6f3f70cd (diff)
downloadmoa-id-spss-7ce4c799eb26f65ef8826b74d0fb09a8d1f4949d.tar.gz
moa-id-spss-7ce4c799eb26f65ef8826b74d0fb09a8d1f4949d.tar.bz2
moa-id-spss-7ce4c799eb26f65ef8826b74d0fb09a8d1f4949d.zip
fixed response handling
Diffstat (limited to 'id')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java22
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java9
2 files changed, 16 insertions, 15 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java
index 7342a45aa..b2f5076b6 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java
@@ -49,8 +49,18 @@ public class AttributeCollector implements IAction {
*/
public String processRequest(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp, AuthenticationSession moasession) throws MOAIDException {
+ // - fetch the container
+ String artifactId = (String) httpReq.getParameter(ARTIFACT_ID);
+ DataContainer container;
+ try {
+ container = AssertionStorage.getInstance().get(artifactId, DataContainer.class);
+ } catch (MOADatabaseException e) {
+ Logger.error("Error fetching incomplete Stork response from temporary storage. Most likely a timeout occured.", e);
+ throw new MOAIDException("stork.11", null);
+ }
+
// read configuration parameters of OA
- OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moasession.getPublicOAURLPrefix());
+ OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(container.getRequest().getAssertionConsumerServiceURL());
if (oaParam == null)
throw new AuthenticationException("stork.12", new Object[]{moasession.getPublicOAURLPrefix()});
@@ -73,16 +83,6 @@ public class AttributeCollector implements IAction {
Logger.error("No attribute could be retrieved from the response the attribute provider gave us.");
}
- // - fetch the container
- String artifactId = (String) httpReq.getAttribute(ARTIFACT_ID);
- DataContainer container;
- try {
- container = AssertionStorage.getInstance().get(artifactId, DataContainer.class);
- } catch (MOADatabaseException e) {
- Logger.error("Error fetching incomplete Stork response from temporary storage. Most likely a timeout occured.", e);
- throw new MOAIDException("stork.11", null);
- }
-
// - insert the embedded attribute(s) into the container
addOrUpdateAll(container.getResponse().getPersonalAttributeList(), newAttributes);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java
index d2f2ff663..638035008 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java
@@ -71,16 +71,17 @@ public class STORKProtocol implements IModulInfo, MOAIDAuthConstants {
Logger.debug("Request content length: " + request.getContentLength());
Logger.debug("Initiating action: " + action);
+ MOASTORKRequest STORK2Request = new MOASTORKRequest();
+
+ if (AttributeCollector.class.getSimpleName().equals(action))
+ return STORK2Request;
+
HTTPInTransport profileReq = new HttpServletRequestAdapter(request);
HTTPOutTransport profileResp = new HttpServletResponseAdapter(response, request.isSecure());
-
BasicSAMLMessageContext samlMessageContext = new BasicSAMLMessageContext();
samlMessageContext.setInboundMessageTransport(profileReq);
- MOASTORKRequest STORK2Request = new MOASTORKRequest();
-
-
//extract STORK Response from HTTP Request
byte[] decSamlToken;
try {