Fix SAML2 samples

This commit is contained in:
Marcus Da Coregio
2023-02-23 11:13:33 -03:00
parent 2b113118c3
commit 1f26a2faea
16 changed files with 32 additions and 27 deletions

View File

@@ -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
```

View File

@@ -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")

View File

@@ -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);