diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-01-27 06:26:52 +0100 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-01-27 06:26:52 +0100 |
commit | 3ca240a596e3d2d22a7a6c68ce9c34dda9168e2c (patch) | |
tree | 322bab6aca57ebadb5014e44676b6c06433adb99 /id/server/modules/moa-id-module-eIDAS/src/main/java | |
parent | 1672ef1dc32bf37c966660c33e422729addd5b41 (diff) | |
download | moa-id-spss-3ca240a596e3d2d22a7a6c68ce9c34dda9168e2c.tar.gz moa-id-spss-3ca240a596e3d2d22a7a6c68ce9c34dda9168e2c.tar.bz2 moa-id-spss-3ca240a596e3d2d22a7a6c68ce9c34dda9168e2c.zip |
set ContentType parameter in HTTPServletResponse
Diffstat (limited to 'id/server/modules/moa-id-module-eIDAS/src/main/java')
2 files changed, 14 insertions, 16 deletions
diff --git a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/auth/modules/eidas/utils/EidasMetaDataServlet.java b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/auth/modules/eidas/utils/EidasMetaDataServlet.java index 470e3b0fc..6ae532210 100644 --- a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/auth/modules/eidas/utils/EidasMetaDataServlet.java +++ b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/auth/modules/eidas/utils/EidasMetaDataServlet.java @@ -15,17 +15,15 @@ * limitations under the Licence. *******************************************************************************/ package at.gv.egovernment.moa.id.auth.modules.eidas.utils; -import iaik.security.ecc.provider.ECCProvider; -import iaik.security.provider.IAIK; import java.io.IOException; -import java.security.Security; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.core.MediaType; import org.slf4j.Logger; @@ -64,7 +62,7 @@ public class EidasMetaDataServlet extends HttpServlet { logger.trace(metaData); - response.setContentType("text/xml"); + response.setContentType(MediaType.TEXT_XML); response.getWriter().print(metaData); response.flushBuffer(); } catch (Exception e) { diff --git a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/AuthenticationRequest.java b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/AuthenticationRequest.java index 1012be1b7..ae9dd5a51 100644 --- a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/AuthenticationRequest.java +++ b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/AuthenticationRequest.java @@ -26,6 +26,14 @@ import java.io.StringWriter; import java.text.SimpleDateFormat; import java.util.Map.Entry; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.core.MediaType; + +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; + import at.gv.egovernment.moa.id.auth.builder.BPKBuilder; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.auth.modules.eidas.Constants; @@ -41,13 +49,6 @@ import at.gv.egovernment.moa.id.moduls.IAction; import at.gv.egovernment.moa.id.moduls.IRequest; import at.gv.egovernment.moa.id.util.VelocityProvider; import at.gv.egovernment.moa.logging.Logger; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.velocity.Template; -import org.apache.velocity.VelocityContext; -import org.apache.velocity.app.VelocityEngine; import eu.eidas.auth.commons.EIDASAuthnResponse; import eu.eidas.auth.commons.EIDASStatusCode; import eu.eidas.auth.commons.EIDASUtil; @@ -149,10 +150,10 @@ public class AuthenticationRequest implements IAction { template.merge(context, writer); Logger.trace("Template merge done"); - Logger.trace("Sending html content: " + writer.getBuffer().toString()); - Logger.trace("Sending html content2 : " + new String(writer.getBuffer())); + Logger.trace("Sending html content : " + new String(writer.getBuffer())); httpResp.getOutputStream().write(writer.getBuffer().toString().getBytes("UTF-8")); + httpResp.setContentType(MediaType.TEXT_HTML); } catch (Exception e) { Logger.error("Velocity error: " + e.getMessage()); @@ -167,9 +168,8 @@ public class AuthenticationRequest implements IAction { } @Override - public String getDefaultActionName() { - // TODO Auto-generated method stub - return null; + public String getDefaultActionName() { + return "eIDAS_AuthnRequest"; } |