diff options
author | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2016-10-25 15:55:58 +0200 |
---|---|---|
committer | Tobias Kellner <tobias.kellner@iaik.tugraz.at> | 2016-10-25 17:00:13 +0200 |
commit | b2aa9ee20c719530cebebd6778ccedde292e6df2 (patch) | |
tree | 459aed9528d7f60690d9d536be9158ffd585b002 /pdf-over-gui/src/main/java | |
parent | 5962867b411bc53bf14938b0312414f040986b54 (diff) | |
download | pdf-over-b2aa9ee20c719530cebebd6778ccedde292e6df2.tar.gz pdf-over-b2aa9ee20c719530cebebd6778ccedde292e6df2.tar.bz2 pdf-over-b2aa9ee20c719530cebebd6778ccedde292e6df2.zip |
Add support for A-Trust tan app interstitial
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java index 32ad1741..0725a431 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java @@ -189,6 +189,26 @@ public class ATrustHandler extends MobileBKUHandler { responseData = executePost(client, post); log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$ + } else if (responseData.contains("tanAppInfo.aspx?sid=")) { //$NON-NLS-1$ + // App info interstitial - skip + log.info("Skipping tan app interstitial"); //$NON-NLS-1$ + + String t_sessionID = MobileBKUHelper.extractSubstring(responseData, "tanAppInfo.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$ + String t_viewState = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__VIEWSTATE", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + String t_eventValidation = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__EVENTVALIDATION", "value"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + + // Post again to skip + MobileBKUHelper.registerTrustedSocketFactory(); + HttpClient client = MobileBKUHelper.getHttpClient(getStatus()); + + PostMethod post = new PostMethod(status.getBaseURL() + "/tanAppInfo.aspx?sid=" + t_sessionID); //$NON-NLS-1$ + post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$ + post.addParameter("__VIEWSTATE", t_viewState); //$NON-NLS-1$ + post.addParameter("__EVENTVALIDATION", t_eventValidation); //$NON-NLS-1$ + post.addParameter("NextBtn", "Weiter"); //$NON-NLS-1$ //$NON-NLS-2$ + + responseData = executePost(client, post); + log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$ } if (responseData.contains("signature.aspx?sid=")) { //$NON-NLS-1$ |