Marcus Da Coregio před 2 roky
rodič
revize
1f26a2faea

+ 1 - 1
servlet/java-configuration/saml2/login/README.adoc

@@ -45,7 +45,7 @@ You will be redirect to the Okta SAML 2.0 IDP
 === Type in your credentials
 
 ```
-User: testuser@spring.security.saml
+User: testuser2@spring.security.saml
 Password: 12345678
 ```
 

+ 1 - 1
servlet/java-configuration/saml2/login/build.gradle

@@ -56,7 +56,7 @@ dependencies {
 	testImplementation "org.springframework:spring-test"
 	testImplementation "org.springframework.security:spring-security-test"
 	testImplementation("org.junit.jupiter:junit-jupiter-api")
-	testImplementation "org.seleniumhq.selenium:htmlunit-driver:2.44.0"
+	testImplementation "org.seleniumhq.selenium:htmlunit-driver:4.8.0"
 	testImplementation 'org.hamcrest:hamcrest:2.2'
 
 	testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")

+ 2 - 2
servlet/java-configuration/saml2/login/src/integTest/java/example/Saml2JavaConfigurationITests.java

@@ -72,7 +72,7 @@ public class Saml2JavaConfigurationITests {
 	void authenticationAttemptWhenValidThenShowsUserEmailAddress() throws Exception {
 		performLogin();
 		HtmlPage home = (HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage();
-		assertThat(home.asText()).contains("You're email address is testuser@spring.security.saml");
+		assertThat(home.asNormalizedText()).contains("You're email address is testuser2@spring.security.saml");
 	}
 
 	@Test
@@ -104,7 +104,7 @@ public class Saml2JavaConfigurationITests {
 		HtmlInput username = form.getInputByName("username");
 		HtmlPasswordInput password = form.getInputByName("password");
 		HtmlSubmitInput submit = login.getHtmlElementById("okta-signin-submit");
-		username.type("testuser@spring.security.saml");
+		username.type("testuser2@spring.security.saml");
 		password.type("12345678");
 		submit.click();
 		this.webClient.waitForBackgroundJavaScript(10000);

+ 1 - 1
servlet/spring-boot/java/saml2/login-single-tenant/README.adoc

@@ -46,7 +46,7 @@ You will be redirect to the Okta SAML 2.0 IDP
 === Type in your credentials
 
 ```
-User: testuser@spring.security.saml
+User: testuser2@spring.security.saml
 Password: 12345678
 ```
 

+ 5 - 5
servlet/spring-boot/java/saml2/login-single-tenant/build.gradle

@@ -1,5 +1,5 @@
 plugins {
-	id 'org.springframework.boot' version '2.5.2'
+	id 'org.springframework.boot' version '2.7.1'
 	id 'io.spring.dependency-management' version '1.0.10.RELEASE'
 	id "nebula.integtest" version "8.2.0"
 	id 'java'
@@ -14,9 +14,9 @@ repositories {
 
 dependencies {
 	constraints {
-		implementation "org.opensaml:opensaml-core:4.1.1"
-		implementation "org.opensaml:opensaml-saml-api:4.1.1"
-		implementation "org.opensaml:opensaml-saml-impl:4.1.1"
+		implementation "org.opensaml:opensaml-core:4.2.0"
+		implementation "org.opensaml:opensaml-saml-api:4.2.0"
+		implementation "org.opensaml:opensaml-saml-impl:4.2.0"
 	}
 	implementation 'org.springframework.boot:spring-boot-starter-security'
 	implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
@@ -24,7 +24,7 @@ dependencies {
 	implementation 'org.springframework.security:spring-security-saml2-service-provider'
 	implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
 
-	testImplementation 'net.sourceforge.htmlunit:htmlunit:2.44.0'
+	testImplementation 'net.sourceforge.htmlunit:htmlunit'
 	testImplementation 'org.springframework.boot:spring-boot-starter-test'
 	testImplementation 'org.springframework.security:spring-security-test'
 }

+ 1 - 0
servlet/spring-boot/java/saml2/login-single-tenant/gradle.properties

@@ -1,2 +1,3 @@
 version=5.8.0-SNAPSHOT
 spring-security.version=5.8.0-SNAPSHOT
+htmlunit.version=2.70.0

+ 7 - 5
servlet/spring-boot/java/saml2/login-single-tenant/src/integTest/java/example/Saml2LoginApplicationITests.java

@@ -56,7 +56,7 @@ public class Saml2LoginApplicationITests {
 	void authenticationAttemptWhenValidThenShowsUserEmailAddress() throws Exception {
 		performLogin();
 		HtmlPage home = (HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage();
-		assertThat(home.asText()).contains("You're email address is testuser@spring.security.saml");
+		assertThat(home.asNormalizedText()).contains("You're email address is testuser2@spring.security.saml");
 	}
 
 	@Test
@@ -82,13 +82,15 @@ public class Saml2LoginApplicationITests {
 	}
 
 	private void performLogin() throws Exception {
-		HtmlPage login = this.webClient.getPage("/");
+		this.webClient.getPage("/");
 		this.webClient.waitForBackgroundJavaScript(10000);
-		HtmlForm form = findForm(login);
+		HtmlPage okta = (HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage();
+		this.webClient.waitForBackgroundJavaScript(10000);
+		HtmlForm form = findForm(okta);
 		HtmlInput username = form.getInputByName("username");
 		HtmlPasswordInput password = form.getInputByName("password");
-		HtmlSubmitInput submit = login.getHtmlElementById("okta-signin-submit");
-		username.type("testuser@spring.security.saml");
+		HtmlSubmitInput submit = okta.getHtmlElementById("okta-signin-submit");
+		username.type("testuser2@spring.security.saml");
 		password.type("12345678");
 		submit.click();
 		this.webClient.waitForBackgroundJavaScript(10000);

+ 1 - 1
servlet/spring-boot/java/saml2/login/README.adoc

@@ -45,7 +45,7 @@ You will be redirect to the Okta SAML 2.0 IDP
 === Type in your credentials
 
 ```
-User: testuser@spring.security.saml
+User: testuser2@spring.security.saml
 Password: 12345678
 ```
 

+ 1 - 0
servlet/spring-boot/java/saml2/login/gradle.properties

@@ -1,2 +1,3 @@
 version=5.8.0-SNAPSHOT
 spring-security.version=5.8.0-SNAPSHOT
+htmlunit.version=2.70.0

+ 4 - 4
servlet/spring-boot/java/saml2/login/src/integTest/java/example/Saml2LoginApplicationITests.java

@@ -55,14 +55,14 @@ public class Saml2LoginApplicationITests {
 	@Test
 	void authenticationAttemptWhenValidThenShowsUserEmailAddress() throws Exception {
 		performLogin();
-		HtmlPage home = (HtmlPage) Saml2LoginApplicationITests.this.webClient.getCurrentWindow().getEnclosedPage();
-		assertThat(home.asNormalizedText()).contains("You're email address is testuser@spring.security.saml");
+		HtmlPage home = (HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage();
+		assertThat(home.asNormalizedText()).contains("You're email address is testuser2@spring.security.saml");
 	}
 
 	@Test
 	void logoutWhenRelyingPartyInitiatedLogoutThenLoginPageWithLogoutParam() throws Exception {
 		performLogin();
-		HtmlPage home = (HtmlPage) Saml2LoginApplicationITests.this.webClient.getCurrentWindow().getEnclosedPage();
+		HtmlPage home = (HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage();
 		HtmlElement rpLogoutButton = home.getHtmlElementById("rp_logout_button");
 		HtmlPage loginPage = rpLogoutButton.click();
 		this.webClient.waitForBackgroundJavaScript(10000);
@@ -90,7 +90,7 @@ public class Saml2LoginApplicationITests {
 		HtmlInput username = form.getInputByName("username");
 		HtmlPasswordInput password = form.getInputByName("password");
 		HtmlSubmitInput submit = okta.getHtmlElementById("okta-signin-submit");
-		username.type("testuser@spring.security.saml");
+		username.type("testuser2@spring.security.saml");
 		password.type("12345678");
 		submit.click();
 		this.webClient.waitForBackgroundJavaScript(10000);

+ 1 - 1
servlet/spring-boot/java/saml2/refreshable-metadata/README.adoc

@@ -50,7 +50,7 @@ You will be redirect to the Okta SAML 2.0 IDP
 === Type in your credentials
 
 ```
-User: testuser@spring.security.saml
+User: testuser2@spring.security.saml
 Password: 12345678
 ```
 

+ 1 - 1
servlet/spring-boot/java/saml2/refreshable-metadata/build.gradle

@@ -24,7 +24,7 @@ dependencies {
 	implementation 'org.springframework.security:spring-security-saml2-service-provider'
 	implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
 
-	testImplementation 'net.sourceforge.htmlunit:htmlunit:2.44.0'
+	testImplementation 'net.sourceforge.htmlunit:htmlunit'
 	testImplementation 'org.springframework.boot:spring-boot-starter-test'
 	testImplementation 'org.springframework.security:spring-security-test'
 }

+ 1 - 0
servlet/spring-boot/java/saml2/refreshable-metadata/gradle.properties

@@ -1,2 +1,3 @@
 version=5.8.0-SNAPSHOT
 spring-security.version=5.8.0-SNAPSHOT
+htmlunit.version=2.70.0

+ 2 - 2
servlet/spring-boot/java/saml2/refreshable-metadata/src/integTest/java/example/Saml2LoginApplicationITests.java

@@ -52,7 +52,7 @@ public class Saml2LoginApplicationITests {
 	void authenticationAttemptWhenValidThenShowsUserEmailAddress() throws Exception {
 		performLogin();
 		HtmlPage home = (HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage();
-		assertThat(home.asText()).contains("You're email address is testuser@spring.security.saml");
+		assertThat(home.asNormalizedText()).contains("You're email address is testuser2@spring.security.saml");
 	}
 
 	private void performLogin() throws Exception {
@@ -62,7 +62,7 @@ public class Saml2LoginApplicationITests {
 		HtmlInput username = form.getInputByName("username");
 		HtmlPasswordInput password = form.getInputByName("password");
 		HtmlSubmitInput submit = login.getHtmlElementById("okta-signin-submit");
-		username.type("testuser@spring.security.saml");
+		username.type("testuser2@spring.security.saml");
 		password.type("12345678");
 		submit.click();
 		this.webClient.waitForBackgroundJavaScript(10000);

+ 1 - 1
servlet/xml/java/saml2/login-logout/build.gradle

@@ -34,7 +34,7 @@ dependencies {
 	testImplementation "org.springframework:spring-test"
 	testImplementation "org.springframework.security:spring-security-test"
 	testImplementation "org.junit.jupiter:junit-jupiter-api"
-	testImplementation 'net.sourceforge.htmlunit:htmlunit:2.44.0'
+	testImplementation 'net.sourceforge.htmlunit:htmlunit:2.70.0'
 	testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
 
 

+ 2 - 2
servlet/xml/java/saml2/login-logout/src/integTest/java/example/Saml2XmlITests.java

@@ -73,7 +73,7 @@ public class Saml2XmlITests {
 	void authenticationAttemptWhenValidThenShowsUserEmailAddress() throws Exception {
 		performLogin();
 		HtmlPage home = (HtmlPage) this.webClient.getCurrentWindow().getEnclosedPage();
-		assertThat(home.asText()).contains("You're email address is testuser@spring.security.saml");
+		assertThat(home.asNormalizedText()).contains("You're email address is testuser2@spring.security.saml");
 	}
 
 	@Test
@@ -105,7 +105,7 @@ public class Saml2XmlITests {
 		HtmlInput username = form.getInputByName("username");
 		HtmlPasswordInput password = form.getInputByName("password");
 		HtmlSubmitInput submit = login.getHtmlElementById("okta-signin-submit");
-		username.type("testuser@spring.security.saml");
+		username.type("testuser2@spring.security.saml");
 		password.type("12345678");
 		submit.click();
 		this.webClient.waitForBackgroundJavaScript(10000);