aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-03-03 09:30:41 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-03-03 09:39:19 +0100
commitbf784b6222784758eb846b0aaf2080b009549be0 (patch)
tree351727f8deb5650427331889df571ebeeee1fd8f /id
parent85da46b80e3b1c3d3565d044c1fba9c07182482b (diff)
downloadmoa-id-spss-bf784b6222784758eb846b0aaf2080b009549be0.tar.gz
moa-id-spss-bf784b6222784758eb846b0aaf2080b009549be0.tar.bz2
moa-id-spss-bf784b6222784758eb846b0aaf2080b009549be0.zip
cleanup
Diffstat (limited to 'id')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java29
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ExternalAttributeRequestRequiredException.java15
2 files changed, 27 insertions, 17 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 93b2b0495..c711d9400 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
@@ -1,6 +1,5 @@
package at.gv.egovernment.moa.id.protocols.stork2;
-import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
@@ -164,11 +163,14 @@ public class AttributeCollector implements IAction {
return "12345"; // TODO what to do here?
}
-
-
}
-
+ /**
+ * generates binary response from given response class.
+ *
+ * @param container the container
+ * @throws MOAIDException the mOAID exception
+ */
private void generateSTORKResponse(DataContainer container) throws MOAIDException {
STORKAuthnResponse authnResponse = container.getResponse();
STORKAuthnRequest authnRequest = container.getRequest();
@@ -187,24 +189,24 @@ public class AttributeCollector implements IAction {
}
Logger.info("STORK SAML Response message succesfully generated ");
- String statusCodeValue = authnResponse.getStatusCode();
-
Logger.debug("authn saml plain:" + authnResponse.getTokenSaml());
Logger.debug("authn saml string:" + new String(authnResponse.getTokenSaml()));
Logger.debug("authn saml encodedx: " + PEPSUtil.encodeSAMLToken(authnResponse.getTokenSaml()));
container.setResponse(authnResponse);
-
}
-
+ /**
+ * writes the storkresponse to the httpresponse using the velocity engine.
+ *
+ * @param httpResp the http resp
+ * @param container the container
+ */
private void generateRedirectResponse(HttpServletResponse httpResp, DataContainer container) {
STORKAuthnResponse authnResponse = container.getResponse();
STORKAuthnRequest authnRequest = container.getRequest();
-
// preparing redirection for the client
-
try {
VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine();
Template template = velocityEngine.getTemplate("/resources/templates/stork2_postbinding_template.html");
@@ -225,18 +227,11 @@ public class AttributeCollector implements IAction {
Logger.debug("Sending html content: " + writer.getBuffer().toString());
Logger.debug("Sending html content2 : " + new String(writer.getBuffer()));
-
httpResp.getOutputStream().write(writer.getBuffer().toString().getBytes());
} catch (Exception e) {
Logger.error("Velocity error: " + e.getMessage());
}
-
- //HttpSession httpSession = this.httpResp.getSession();
- //httpSession.setAttribute("STORKSessionID", "12345");
- //Logger.info("Status code again: " + authnResponse.getStatusCode());
-
- //return "12345"; // AssertionId
}
/* (non-Javadoc)
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ExternalAttributeRequestRequiredException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ExternalAttributeRequestRequiredException.java
index 29b09487b..56f31723c 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ExternalAttributeRequestRequiredException.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ExternalAttributeRequestRequiredException.java
@@ -1,12 +1,27 @@
package at.gv.egovernment.moa.id.protocols.stork2;
public class ExternalAttributeRequestRequiredException extends Exception {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 5207631348933518908L;
+
+ /** The ap. */
private AttributeProvider ap;
+ /**
+ * Instantiates a new external attribute request required exception.
+ *
+ * @param provider the provider
+ */
public ExternalAttributeRequestRequiredException(AttributeProvider provider) {
ap = provider;
}
+ /**
+ * Gets the ap.
+ *
+ * @return the ap
+ */
public AttributeProvider getAp() {
return ap;
}