[java-idp-integration-tests] branch master updated: IDP-1549 - Negative test for anti-csrf token
Phil Smart
philip.smart at jisc.ac.uk
Thu Feb 20 13:01:38 EST 2020
This is an automated email from the git hooks/post-receive script.
philsmart pushed a commit to branch master
in repository java-idp-integration-tests.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-integration-tests.git;a=commit;h=8cd7226b49a0c5f872f3b31ef3153c6596e9e8a5
The following commit(s) were added to refs/heads/master by this push:
new 8cd7226 IDP-1549 - Negative test for anti-csrf token
8cd7226 is described below
commit 8cd7226b49a0c5f872f3b31ef3153c6596e9e8a5
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Thu Feb 20 18:01:17 2020 +0000
IDP-1549 - Negative test for anti-csrf token
Make test available for v4 only. Stop breakage on v3.
https://issues.shibboleth.net/jira/browse/IDP-1549
---
.../idp/test/ui/csrf/CSRFMitigationTest.java | 27 +++++++++++++---------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/src/test/java/net/shibboleth/idp/test/ui/csrf/CSRFMitigationTest.java b/src/test/java/net/shibboleth/idp/test/ui/csrf/CSRFMitigationTest.java
index 11e1a9a..ca990fa 100644
--- a/src/test/java/net/shibboleth/idp/test/ui/csrf/CSRFMitigationTest.java
+++ b/src/test/java/net/shibboleth/idp/test/ui/csrf/CSRFMitigationTest.java
@@ -74,6 +74,7 @@ public class CSRFMitigationTest extends BaseIntegrationTest {
/**
*
* Check that a username/password login form submitted without an anti-csrf token renders the invalid CSRF token page.
+ * <p>Currently for v4 only</p>
*
* @param browserData the browser data
* @throws Exception on exception
@@ -81,18 +82,22 @@ public class CSRFMitigationTest extends BaseIntegrationTest {
@Test(dataProvider = "sauceOnDemandBrowserDataProvider")
public void testCSRFTokenRemovedFromLoginPage(@Nullable final BrowserData browserData) throws Exception {
- startSeleniumClient(browserData);
+ if (idpVersion.startsWith("4")) {
+
+ startSeleniumClient(browserData);
+
+ //make sure CSRF protection is enabled
+ replaceIdPProperty("idp.csrf.enabled", "true");
+ //make sure we are using the password flow
+ replaceIdPProperty("idp.authn.flows", "Password");
+
+ startServer();
+ startFlow();
+ waitForLoginPage();
+ removeCSRFTokenAndlogin("jdoe","changeit");
+ checkCSRFErrorPage();
- //make sure CSRF protection is enabled
- replaceIdPProperty("idp.csrf.enabled", "true");
- //make sure we are using the password flow
- replaceIdPProperty("idp.authn.flows", "Password");
-
- startServer();
- startFlow();
- waitForLoginPage();
- removeCSRFTokenAndlogin("jdoe","changeit");
- checkCSRFErrorPage();
+ }
}
/**
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list