From 2717f5698bdbbbe7889ebea533cf2d187c8ccd44 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:33:44 +0000 Subject: Ensure session ID on redirects (if necessary) git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@382 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../gui/workflow/states/mobilebku/AbstractMobileBKUStatusImpl.java | 5 +++++ .../pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java | 2 ++ .../pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java | 7 +++++++ .../asit/pdfover/gui/workflow/states/mobilebku/PostTanThread.java | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) (limited to 'pdf-over-gui/src/main/java/at/asit') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/AbstractMobileBKUStatusImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/AbstractMobileBKUStatusImpl.java index deb7b16a..37b99fba 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/AbstractMobileBKUStatusImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/AbstractMobileBKUStatusImpl.java @@ -130,4 +130,9 @@ public abstract class AbstractMobileBKUStatusImpl implements MobileBKUStatus { public void setSignatureDataURL(String signatureDataURL) { this.signatureDataURL = signatureDataURL; } + + @Override + public String ensureSessionID(String url) { + return url; + } } \ No newline at end of file diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java index 1193ffcd..e65f2fb9 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java @@ -258,6 +258,8 @@ public abstract class MobileBKUHandler { } if (redirectLocation != null) { + redirectLocation = getStatus().ensureSessionID(redirectLocation); + log.debug("Redirected to " + redirectLocation); //$NON-NLS-1$ get = new GetMethod(redirectLocation); get.setFollowRedirects(true); returnCode = client.executeMethod(get); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java index 2c1367bc..7ebf7b3e 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java @@ -130,4 +130,11 @@ public interface MobileBKUStatus { * @param signatureDataURL the signature data URL */ public void setSignatureDataURL(String signatureDataURL); + + /** + * Ensure that given URL contains a session ID (if necessary) + * @param url URL to check for session ID + * @return resulting URL + */ + public String ensureSessionID(String url); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostTanThread.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostTanThread.java index 0774cf7a..95ee0dbd 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostTanThread.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostTanThread.java @@ -56,7 +56,7 @@ public class PostTanThread implements Runnable { String responseData = this.handler.postTAN(); // Now we have received some data lets check it: - log.debug("Response from A-Trust: " + responseData); //$NON-NLS-1$ + log.debug("Response from mobile BKU: " + responseData); //$NON-NLS-1$ this.handler.handleTANResponse(responseData); -- cgit v1.2.3